-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Fix error message on setter with wrong type #20444
Conversation
@@ -1334,12 +1334,9 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer | |||
|
|||
val setter = toSetter(lhsCore) | |||
if setter.isEmpty then reassignmentToVal |
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.
When can setter
actually be empty? We haven't found any such cases.
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.
When the pattern match in toSetter
gets to the default case. But I am not sure this is ever the case. On the other hand, programs with parse errors can give uncommon trees, so better be defensive.
Test failure:
The check file for i20338b seems to be incorrect. |
Co-authored-by: Matt Bovel<[email protected]> Co-authored-by: Nicolas Stucki<> Co-authored-by: Hamza Remmal<> Co-authored-by: Mehdi Alaoui<> fix check file
@@ -1334,12 +1334,9 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer | |||
|
|||
val setter = toSetter(lhsCore) | |||
if setter.isEmpty then reassignmentToVal |
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.
When the pattern match in toSetter
gets to the default case. But I am not sure this is ever the case. On the other hand, programs with parse errors can give uncommon trees, so better be defensive.
Backports #20444 to the LTS branch. PR submitted by the release tooling. [skip ci]
Fixes #20338
Poke @mbovel @nicolasstucki @hamzaremmal @AnotherMedo