-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Phase consistency involving higher-kinded types #5962
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Related: phase consistency for path-dependent types #5961 (comment) |
You can encode the missing type tag with import scala.quoted._
import scala.tasty._
class MatchFactory1[T, S[_]] {
def f: Int = 2
}
object MatcherFactory1 {
def impl[T: Type, S[_], M >: MatchFactory1[T, S] <: MatchFactory1[T, S] : Type](self: Expr[M])(implicit refl: Reflection, tpS: Type[S[T]]) =
'{ val a = ~self; a.f }
} |
@nicolasstucki The encoding does not compile when there is inner class, type projection only allowed on non-concrete types under import scala.quoted._
import scala.tasty._
class MatchFactory1[T, S[_]] { outer =>
class Inner {
val owner = outer
}
}
object MatcherFactory1 {
def impl[T: Type, S[_], M >: MatchFactory1[T, S] <: MatchFactory1[T, S] : Type](self: Expr[M#Inner])(implicit refl: Reflection, tpS: Type[S[T]]): Expr[M] =
'{ (~self).owner }
} We could move |
@odersky Mentioned we could change the parameter of sealed abstract class Type[T <: AnyKind] {
type unary_~ = T
}
class Test {
def foo(ev: Type[List]): Int = ???
} However, this requires enable the flag |
When a higher-kinded type
S
is used in quote/splice, do we need an evidence ofType[S]
orType[S[X]]
? Neither type checks.The text was updated successfully, but these errors were encountered: