Skip to content

Fix #2345: Handle case of overloaded local vars in assignment #2346

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 2 commits into from
May 2, 2017

Conversation

odersky
Copy link
Contributor

@odersky odersky commented May 2, 2017

Clean up logic of typedAssign, so that it now correctly handles the case
of an overloaded left-hand-side consisting of a provate[this] var
and one or more methods.

Clean up logic of typedAssign, so that it now correctly handles the case
of an overloaded left-hand-side consisting of a provate[this] var
and one or more methods.
@odersky odersky requested a review from felixmulder May 2, 2017 12:42
@@ -567,37 +567,42 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit
case lhs =>
val lhsCore = typedUnadapted(lhs, AssignProto)
def lhs1 = typed(untpd.TypedSplice(lhsCore))
def canAssign(sym: Symbol) = // allow assignments from the primary constructor to class fields
lazy val lhsVal = lhsCore.asInstanceOf[TermRef].denot.suchThat(!_.is(Method))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That lazy val seems unused.

Copy link
Contributor

@felixmulder felixmulder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch @smarter - LGTM

@felixmulder felixmulder merged commit 5514655 into scala:master May 2, 2017
@allanrenucci allanrenucci deleted the fix-#2345 branch December 14, 2017 19:18
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