-
Notifications
You must be signed in to change notification settings - Fork 1.1k
HK type aliasing bug #3658
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
I'd argue the program should be rejected. |
@odersky I think there's some missing dealias somewhere, there's no self-application as the two |
It works if you do: object App {
def main(args: Array[String]): Unit = {
trait ModuleSig {
type F[_]
type Type = F
def subst[F[_[_]]](fa: F[[X] => List[X]]): F[Type]
}
val Module: ModuleSig = new ModuleSig {
type F[A] = List[A]
def subst[F[_[_]]](fa: F[[X] => List[X]]): F[Type] = fa
}
}
} This is the same kind of bug as #2989, (I have a potential fix for #2989 at https://github.com/dotty-staging/dotty/commits/fix-eta-expansion-new but it doesn't seem to handle this case. I really wish we could find a more principled way to write hk subtyping checks). |
Turns out, if you change it to
is compiles, too. So the question is, is
not
|
doesn't compile, but if you change
to
it does...
The text was updated successfully, but these errors were encountered: