File tree Expand file tree Collapse file tree 8 files changed +20
-6
lines changed
compiler/src/dotty/tools/dotc/transform Expand file tree Collapse file tree 8 files changed +20
-6
lines changed Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ object OverridingPairs {
4040 * relative to <base>.this do
4141 */
4242 protected def matches (sym1 : Symbol , sym2 : Symbol ): Boolean =
43- sym1.isType || self.memberInfo(sym1 ).matches(self.memberInfo(sym2 ))
43+ sym1.isType || sym1.asSeenFrom(self ).matches(sym2.asSeenFrom(self ))
4444
4545 /** The symbols that can take part in an overriding pair */
4646 private val decls = {
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ class Foo {
55
66 def bar (): Unit = {
77 val listener4 = new NotificationListener () { // error: duplicate symbol error
8- def handleNotification (n : Notification | Null , emitter : Object ): Unit = {
8+ def handleNotification (n : Notification | Null , emitter : Object ): Unit = { // error
99 }
1010 }
1111 }
Original file line number Diff line number Diff line change 1- case class Foo1 (erased x : Int ) // error
1+ case class Foo1 (erased x : Int ) // error // error
Original file line number Diff line number Diff line change 11object Test extends App {
22 def foo [S <: String ]: String => Int =
3- new (String => Int ) { def apply (s : S ): Int = 0 } // error
3+ new (String => Int ) { def apply (s : S ): Int = 0 } // error // error
44
55 trait Fn [A , B ] {
66 def apply (x : A ): B
77 }
88
99 class C [S <: String ] extends Fn [String , Int ] { // error
10- def apply (s : S ): Int = 0
10+ def apply (s : S ): Int = 0 // error
1111 }
1212
1313 foo(" " )
Original file line number Diff line number Diff line change 1+ public class A {
2+ public <T extends java .io .Serializable > void foo (T x ) {}
3+ public <T extends Cloneable > void foo (T x ) {}
4+ }
Original file line number Diff line number Diff line change 1+ class B extends A {
2+ override def foo [T <: Serializable ](x : T ): Unit = {}
3+ }
Original file line number Diff line number Diff line change 1+ class A {
2+ def foo [T <: Serializable ](x : T ): Unit = {}
3+ def foo [T <: Cloneable ](x : T ): Unit = {}
4+ }
5+ class B extends A {
6+ override def foo [T <: Serializable ](x : T ): Unit = {}
7+ }
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ trait Animal {
1414trait Cow extends Animal {
1515 type IsMeat = Any
1616 type Food <: Grass
17- def eats (food : Grass ): Unit
17+ def eats (food : Food ): Unit
1818 def gets : Food
1919}
2020trait Lion extends Animal {
You can’t perform that action at this time.
0 commit comments