-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Inherited members can induce ambiguity
Spec binding precedence of inherited definition. Use -Ylegacy-binding for old precedence.
- Loading branch information
Showing
24 changed files
with
346 additions
and
76 deletions.
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
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
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
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
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 @@ | ||
t11921.scala:6: error: reference to coll is ambiguous; | ||
it is both defined in method lazyMap and available as method coll in trait Iterable | ||
Since 2.13.11, symbols inherited from a superclass no longer shadow symbols defined in an outer scope. | ||
If shadowing was intended, write `this.coll`. | ||
Or use `-Ylegacy-binding` to enable the previous behavior everywhere. | ||
def iterator = coll.iterator.map(f) // coll is ambiguous | ||
^ | ||
1 error |
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 @@ | ||
|
||
|
||
class C { | ||
def lazyMap[A, B](coll: Iterable[A], f: A => B) = | ||
new Iterable[B] { | ||
def iterator = coll.iterator.map(f) // coll is ambiguous | ||
} | ||
} | ||
|
||
/* was: | ||
t11921.scala:5: error: type mismatch; | ||
found : A => B | ||
required: B => B | ||
def iterator = coll.iterator.map(f) | ||
^ | ||
*/ |
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,29 @@ | ||
t11921b.scala:11: error: reference to x is ambiguous; | ||
it is both defined in object Test and available as value x in class C | ||
Since 2.13.11, symbols inherited from a superclass no longer shadow symbols defined in an outer scope. | ||
If shadowing was intended, write `this.x`. | ||
Or use `-Ylegacy-binding` to enable the previous behavior everywhere. | ||
println(x) // error | ||
^ | ||
t11921b.scala:15: error: reference to x is ambiguous; | ||
it is both defined in object Test and available as value x in class C | ||
Since 2.13.11, symbols inherited from a superclass no longer shadow symbols defined in an outer scope. | ||
If shadowing was intended, write `this.x`. | ||
Or use `-Ylegacy-binding` to enable the previous behavior everywhere. | ||
println(x) // error | ||
^ | ||
t11921b.scala:26: error: reference to y is ambiguous; | ||
it is both defined in method c and available as value y in class D | ||
Since 2.13.11, symbols inherited from a superclass no longer shadow symbols defined in an outer scope. | ||
If shadowing was intended, write `this.y`. | ||
Or use `-Ylegacy-binding` to enable the previous behavior everywhere. | ||
println(y) // error | ||
^ | ||
t11921b.scala:38: error: reference to y is ambiguous; | ||
it is both defined in method c and available as value y in class D | ||
Since 2.13.11, symbols inherited from a superclass no longer shadow symbols defined in an outer scope. | ||
If shadowing was intended, write `this.y`. | ||
Or use `-Ylegacy-binding` to enable the previous behavior everywhere. | ||
println(y) // error | ||
^ | ||
4 errors |
Oops, something went wrong.