Skip to content

Ensure trait var accessor type is widened #5367

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

Merged
merged 1 commit into from
Aug 29, 2016

Conversation

adriaanm
Copy link
Contributor

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.

@scala-jenkins scala-jenkins added this to the 2.12.1 milestone Aug 29, 2016
@adriaanm adriaanm modified the milestones: 2.12.0-RC1, 2.12.1 Aug 29, 2016
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.
@szeiger
Copy link
Contributor

szeiger commented Aug 29, 2016

LGTM

@szeiger szeiger merged commit 4d3fd6d into scala:2.12.x Aug 29, 2016
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.
@adriaanm adriaanm added the 2.12 label Oct 29, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants