-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fix #2675: Properly handle undetermined type variables in unapply #3889
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
In non-variant contexts, we used to always maximize them, but this is unsound. See neg/patternUnsoundness.scala. We now create fresh abstract types in these situations.
Make bind-defined symbols forward-referencable. This is necessary to support more interesting patterns of Binds. E.g. in case (bla: List[t]) the bound symbol `bla` refers to the bound type `t` in its info. Previously we used BindDefinedType for that, but that cannot work in general, because it does not distinguish between a reference and a binding.
Have to modify the way templates are scanned, so far, all non-member definitions inside a template were forgotten. Strangely enough this caused a completely unrelated fromTastyTest to fail.
A clause was accidentally disabled fir debugging purposes.
|
||
x match { | ||
case x: C[u] => | ||
def x: u = x |
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.
Is the self-recursive call intended here?
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.
I assume so, it was an old test in pos. The new test in pickling adds more variations that exercise forward binds in pickling.
With the changes in the last commit, the symbol of a Bind always exists.
In non-variant contexts, we used to always maximize undetermined type variables, but this is unsound. See neg/patternUnsoundness.scala. We now create fresh abstract types in
these situations. This forced us to also fix the pickling and unpickling of Bind nodes.