File tree Expand file tree Collapse file tree 2 files changed +19
-2
lines changed Expand file tree Collapse file tree 2 files changed +19
-2
lines changed Original file line number Diff line number Diff line change
1
+ // yet another variant, testing super accessors
2
+
3
+ trait T {
4
+ def foo [B ](x : C [B ]): C [B ]
5
+ }
6
+ abstract class A extends T {
7
+ type C [X ]
8
+ def foo [B ](x : C [B ]): C [B ] = {println(" A.C" ); x}
9
+ def foo [B ](x : List [B ]): List [B ] = {println(" A.List" ); x}
10
+ }
11
+ trait U extends T {
12
+ def foo [B ](x : C [B ]): C [B ] = super .foo[B ](x)
13
+ }
14
+ object Test extends A with U {
15
+ type C [X ] = List [X ]
16
+ def main (args : Array [String ]) = foo(List (" " ))
17
+ }
Original file line number Diff line number Diff line change 1
1
// A tricky case of overriding behavior
2
- // Note: It would be acceptable if this produced an error instead.
3
- // Bit testing this is tricky.
2
+ // Note: It might be acceptable if this produced an error instead.
3
+ // But testing this is tricky.
4
4
abstract class Base [T ] {
5
5
def foo (x : T ): String
6
6
}
You can’t perform that action at this time.
0 commit comments