Skip to content

Fix #2324: Check contexts in right order when looking for idents #2327

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 3 commits into from
Apr 28, 2017

Conversation

odersky
Copy link
Contributor

@odersky odersky commented Apr 28, 2017

The previous logic would look for members of a class in the outermost scope
where the class is owner. But it should be the innermost scope.

odersky added 3 commits April 28, 2017 16:54
The previous logic would look for members of a class in the outermost scope
where the class is owner. But it should be the innermost scope.
@odersky odersky requested a review from smarter April 28, 2017 15:57
@@ -2,7 +2,7 @@ package bar { object bippy extends (Double => String) { def apply(x: Double): St
package object println { def bippy(x: Int, y: Int, z: Int) = "(Int, Int, Int)" }
object Test {
def main(args: Array[String]): Unit = {
println(bar.bippy(5.5))
println(bar.bippy(5.5)) // error
println(bar.bippy(1, 2, 3)) // error
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't there be two errors here now? One for the println and one for bippy. That's what happens in scalac.

Copy link
Contributor Author

@odersky odersky Apr 28, 2017

Choose a reason for hiding this comment

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

Yes, but that's unrelated. Maybe they have the same position in dotty, or we are more aggressive about propagating error types. Anyway we went from 1 to 2 errors, so it's an improvement :-)

Copy link
Member

@smarter smarter left a comment

Choose a reason for hiding this comment

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

Alright, LGTM!

@odersky odersky merged commit 206ba59 into scala:master Apr 28, 2017
@allanrenucci allanrenucci deleted the fix-#2324 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.

2 participants