-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add missing case to TypeComparer #3713
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
Conversation
The missing case was for hk-type ref <:< hk type lambda E.g. type Y[X] Foo[Y] <:< Foo[[T] => Y[T]]
if (tp1.isHK) { | ||
val tparams1 = tp1.typeParams | ||
return isSubType( | ||
HKTypeLambda.fromParams(tparams1, tp1.appliedTo(tparams1.map(_.paramRef))), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can be written EtaExpansion(tp1)
I think.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
EtaExpansion only works for class type constructors. I tried to change that, but it would be quite involved, so I thought it was simpler to write the code directly here.
@@ -1065,7 +1065,7 @@ object desugar { | |||
AppliedTypeTree(ref(seqType), t), | |||
New(ref(defn.RepeatedAnnotType), Nil :: Nil)) | |||
} else { | |||
assert(ctx.mode.isExpr || ctx.reporter.hasErrors, ctx.mode) | |||
assert(ctx.mode.isExpr || ctx.reporter.hasErrors || ctx.mode.is(Mode.Interactive), ctx.mode) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any idea why we manage to hit this assertion in the IDE?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No idea, I am afraid.
The missing case was for
E.g.