File tree 1 file changed +8
-13
lines changed
1 file changed +8
-13
lines changed Original file line number Diff line number Diff line change @@ -21,15 +21,11 @@ object Test3 {
21
21
trait YY extends XX {
22
22
type Foo = X & Y
23
23
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
25
27
}
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
33
29
}
34
30
35
31
object Test4 {
@@ -53,10 +49,9 @@ object Test4 {
53
49
trait YY extends XX {
54
50
type Foo = X & Y
55
51
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
57
55
}
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
62
57
}
You can’t perform that action at this time.
0 commit comments