Skip to content

Commit 3a97b3f

Browse files
committed
Another test case involving super accessors
1 parent 9aa800f commit 3a97b3f

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

tests/neg/i1240b.scala

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
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+
}

tests/run/i1240.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// 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.
44
abstract class Base[T] {
55
def foo(x: T): String
66
}

0 commit comments

Comments
 (0)