Skip to content

Commit ba21f73

Browse files
committed
Add one more testcase.
1 parent 28d11d6 commit ba21f73

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

tests/run/i2337b.scala

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/*
2+
Minimized from collection strawman
3+
This issue has a lot to do with both mixin and bridge generation and subtleties in JVM spec
4+
if something breaks in this test, this is not a minor issue. Be careful. Here be dragons.
5+
*/
6+
7+
trait Define[A] {
8+
protected def coll: Define[A]
9+
def s = coll
10+
}
11+
12+
trait Iterable[A] extends Define[A] {
13+
protected def coll: this.type = this
14+
}
15+
16+
trait Seq[A] extends Iterable[A]
17+
18+
trait Super1[A] {
19+
protected def coll: Iterable[A]
20+
}
21+
22+
trait Super2[A] extends Super1[A] {
23+
override protected def coll: Seq[A]
24+
def bar = coll
25+
}
26+
27+
class Foo[T] extends Seq[T] with Super2[T] {
28+
}
29+
30+
object Test {
31+
def main(args: Array[String]): Unit = {
32+
val foo = new Foo[Int]
33+
foo.s
34+
val su2: Super2[Int] = foo
35+
su2.bar
36+
}
37+
}

0 commit comments

Comments
 (0)