Ensure trait var accessor type is widened#5367
Merged
szeiger merged 1 commit intoscala:2.12.xfrom Aug 29, 2016
Merged
Conversation
If we don't widen, we'll fail to find the setter when typing `x = 42`, because `x` is constant-folded to `0`, as its type is `=> Int(0)`. After widening, `x` is type checked to `x` and its symbol is the getter in the trait, which can then be rewritten to the setter. Regression spotted and test case by szeiger.
ab61fed to
0fbb427
Compare
Contributor
|
LGTM |
szeiger
added a commit
to szeiger/community-builds
that referenced
this pull request
Aug 29, 2016
Switch to scala/scala-java8-compat#76 which should work on 2.12.x now that scala/scala#5367 was also merged.
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.
If we don't widen, we'll fail to find the setter when
typing
x = 42, becausexis constant-folded to0,as its type is
=> Int(0). After widening,xistype checked to
xand its symbol is the getter in thetrait, which can then be rewritten to the setter.
Regression spotted and test case by @szeiger.