Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9834 from dotty-staging/fix-#9803
Fix #9803: Use right context for reporting ambiguous references
- Loading branch information
Showing
3 changed files
with
25 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
-- [E049] Reference Error: tests/neg/i9803.scala:15:10 ----------------------------------------------------------------- | ||
15 | println(f421()) // error | ||
| ^^^^ | ||
| Reference to f421 is ambiguous, | ||
| it is both imported by name by import bugs.shadowing.x.f421 | ||
| and imported by name subsequently by import bugs.shadowing.y.f421 | ||
|
||
longer explanation available when compiling with `-explain` |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package bugs.shadowing | ||
|
||
object x { | ||
def f421() = 1 | ||
} | ||
|
||
object y { | ||
def f421() = true | ||
} | ||
|
||
import x.f421 | ||
import y.f421 | ||
|
||
object test { | ||
println(f421()) // error | ||
} |