Fix #2675: Properly handle undetermined type variables in unapply#3889
Merged
smarter merged 13 commits intoscala:masterfrom Feb 1, 2018
Merged
Fix #2675: Properly handle undetermined type variables in unapply#3889smarter merged 13 commits intoscala:masterfrom
smarter merged 13 commits intoscala:masterfrom
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.
smarter
reviewed
Jan 23, 2018
|
|
||
| x match { | ||
| case x: C[u] => | ||
| def x: u = x |
Member
There was a problem hiding this comment.
Is the self-recursive call intended here?
Contributor
Author
There was a problem hiding this comment.
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.
This was referenced Jan 24, 2018
smarter
approved these changes
Feb 1, 2018
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.