Skip to content

Commit 1128d81

Browse files
Update neg test after override check changes
1 parent 55a8ee9 commit 1128d81

File tree

1 file changed

+8
-13
lines changed

1 file changed

+8
-13
lines changed

tests/neg/6314-6.scala

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,11 @@ object Test3 {
2121
trait YY extends XX {
2222
type Foo = X & Y
2323

24-
def apply(fa: Bar[X & Foo]): Bar[Y & Foo] = fa
24+
def apply(fa: Bar[X & Foo]): Bar[Y & Foo] = fa // error
25+
// overriding method apply in trait XX of type (fa: String): Int;
26+
// method apply of type (fa: String): String has incompatible type
2527
}
26-
(new YY {}).boom // error
27-
// object creation impossible, since def apply(fa: String):
28-
// Int is not defined (Note that String does not match
29-
// Test3.Bar[X & Object with Test3.YY {...}#Foo])
30-
31-
// So the apply in YY doesn't implements the one in XX, and
32-
// everything is nice and sound.
28+
(new YY {}).boom
3329
}
3430

3531
object Test4 {
@@ -53,10 +49,9 @@ object Test4 {
5349
trait YY extends XX {
5450
type Foo = X & Y
5551

56-
def apply(fa: Bar[X & FooAlias]): Bar[Y & FooAlias] = fa
52+
def apply(fa: Bar[X & FooAlias]): Bar[Y & FooAlias] = fa // error
53+
// overriding method apply in trait XX of type (fa: String): Int;
54+
// method apply of type (fa: String): String has incompatible type
5755
}
58-
(new YY {}).boom // error
59-
// object creation impossible, since def apply(fa: String):
60-
// Int is not defined (Note that String does not match
61-
// Test4.Bar[X & Object with Test4.YY {...}#FooAlias])
56+
(new YY {}).boom
6257
}

0 commit comments

Comments
 (0)