-
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.
remove heuristic, turn into a warning
- Loading branch information
Showing
8 changed files
with
111 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,31 @@ | ||
t11921-alias.scala:16: error: reference to TT is ambiguous; | ||
it is both defined in object O and available as type TT 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.TT`. | ||
Or use `-Ylegacy-binding` to enable the previous behavior everywhere. | ||
t11921-alias.scala:18: warning: reference to TT is ambiguous; | ||
it is both defined in the enclosing object O and available in the enclosing class D as type TT (defined in class C) | ||
Since 3, symbols inherited from a superclass no longer shadow symbols defined in an outer scope. | ||
To continue using the symbol from the superclass, write `this.TT`. | ||
Or use `-Wconf:msg=legacy-binding` to silence this warning. | ||
def n(x: TT) = x // ambiguous | ||
^ | ||
t11921-alias.scala:36: error: reference to c is ambiguous; | ||
it is both defined in class B and available as value c in class A | ||
Since 2.13.11, symbols inherited from a superclass no longer shadow symbols defined in an outer scope. | ||
If shadowing was intended, write `this.c`. | ||
Or use `-Ylegacy-binding` to enable the previous behavior everywhere. | ||
t11921-alias.scala:38: warning: reference to c is ambiguous; | ||
it is both defined in the enclosing class B and available in the enclosing anonymous class as value c (defined in class A) | ||
Since 3, symbols inherited from a superclass no longer shadow symbols defined in an outer scope. | ||
To continue using the symbol from the superclass, write `this.c`. | ||
Or use `-Wconf:msg=legacy-binding` to silence this warning. | ||
def n = c // ambiguous | ||
^ | ||
t11921-alias.scala:65: error: reference to name is ambiguous; | ||
it is both defined in method m and available as value name in class A | ||
Since 2.13.11, symbols inherited from a superclass no longer shadow symbols defined in an outer scope. | ||
If shadowing was intended, write `this.name`. | ||
Or use `-Ylegacy-binding` to enable the previous behavior everywhere. | ||
t11921-alias.scala:57: warning: reference to name is ambiguous; | ||
it is both defined in the enclosing method m and available in the enclosing anonymous class as value name (defined in class C) | ||
Since 3, symbols inherited from a superclass no longer shadow symbols defined in an outer scope. | ||
To continue using the symbol from the superclass, write `this.name`. | ||
Or use `-Wconf:msg=legacy-binding` to silence this warning. | ||
println(name) | ||
^ | ||
3 errors | ||
t11921-alias.scala:67: warning: reference to name is ambiguous; | ||
it is both defined in the enclosing method m and available in the enclosing anonymous class as value name (defined in class A, inherited through parent class C) | ||
Since 3, symbols inherited from a superclass no longer shadow symbols defined in an outer scope. | ||
To continue using the symbol from the superclass, write `this.name`. | ||
Or use `-Wconf:msg=legacy-binding` to silence this warning. | ||
println(name) | ||
^ | ||
error: No warnings can be incurred under -Werror. | ||
4 warnings | ||
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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
// scalac: -Werror | ||
|
||
object t1 { | ||
class C[T] { type TT = T } | ||
object O { | ||
|
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 |
---|---|---|
@@ -1,8 +1,14 @@ | ||
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. | ||
t11921.scala:6: error: type mismatch; | ||
found : A => B | ||
required: B => B | ||
def iterator = coll.iterator.map(f) // coll is ambiguous | ||
^ | ||
t11921.scala:6: warning: reference to coll is ambiguous; | ||
it is both defined in the enclosing method lazyMap and available in the enclosing anonymous class as method coll (defined in trait Iterable) | ||
Since 3, symbols inherited from a superclass no longer shadow symbols defined in an outer scope. | ||
To continue using the symbol from the superclass, write `this.coll`. | ||
Or use `-Wconf:msg=legacy-binding` to silence this warning. | ||
def iterator = coll.iterator.map(f) // coll is ambiguous | ||
^ | ||
1 warning | ||
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 |
---|---|---|
@@ -1,29 +1,38 @@ | ||
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. | ||
t11921b.scala:11: warning: reference to x is ambiguous; | ||
it is both defined in the enclosing object Test and available in the enclosing class D as value x (defined in class C) | ||
Since 3, symbols inherited from a superclass no longer shadow symbols defined in an outer scope. | ||
To continue using the symbol from the superclass, write `this.x`. | ||
Or use `-Wconf:msg=legacy-binding` to silence this warning. | ||
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. | ||
t11921b.scala:15: warning: reference to x is ambiguous; | ||
it is both defined in the enclosing object Test and available in the enclosing anonymous class as value x (defined in class C) | ||
Since 3, symbols inherited from a superclass no longer shadow symbols defined in an outer scope. | ||
To continue using the symbol from the superclass, write `this.x`. | ||
Or use `-Wconf:msg=legacy-binding` to silence this warning. | ||
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. | ||
t11921b.scala:26: warning: reference to y is ambiguous; | ||
it is both defined in the enclosing method c and available in the enclosing anonymous class as value y (defined in class D) | ||
Since 3, symbols inherited from a superclass no longer shadow symbols defined in an outer scope. | ||
To continue using the symbol from the superclass, write `this.y`. | ||
Or use `-Wconf:msg=legacy-binding` to silence this warning. | ||
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. | ||
t11921b.scala:38: warning: reference to y is ambiguous; | ||
it is both defined in the enclosing method c and available in the enclosing class E as value y (defined in class D) | ||
Since 3, symbols inherited from a superclass no longer shadow symbols defined in an outer scope. | ||
To continue using the symbol from the superclass, write `this.y`. | ||
Or use `-Wconf:msg=legacy-binding` to silence this warning. | ||
println(y) // error | ||
^ | ||
4 errors | ||
t11921b.scala:75: warning: reference to x is ambiguous; | ||
it is both defined in the enclosing object Uhu and available in the enclosing class C as value x (defined in class A, inherited through parent class B) | ||
Since 3, symbols inherited from a superclass no longer shadow symbols defined in an outer scope. | ||
To continue using the symbol from the superclass, write `this.x`. | ||
Or use `-Wconf:msg=legacy-binding` to silence this warning. | ||
def t = x // ambiguous, message mentions parent B | ||
^ | ||
error: No warnings can be incurred under -Werror. | ||
5 warnings | ||
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