Skip to content

Commit 4c8aab0

Browse files
committed
Test case for the status quo in specialized traits
A deferred method in the generic interface ends up with a corresponding, generically substituted version in the specialized sub interface. This is superfluous and problematic when we start adding default methods to the interfaces. The subsequent commit will remove them.
1 parent 2f7a622 commit 4c8aab0

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
public abstract void T$mcI$sp.t(int)
2+
public abstract void T.t(java.lang.Object)
3+
0
4+
0
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
trait T[@specialized A] {
2+
def t(a: A): Unit
3+
}
4+
5+
object Test {
6+
def main(args: Array[String]): Unit = {
7+
class TInt extends T[Int] { def t(a : Int) = println(a) }
8+
val tMethods = classOf[TInt].getInterfaces.head.getMethods.filter(_.getName == "t")
9+
println(tMethods.map(_.toString).sorted.mkString("\n"))
10+
new TInt().t(0)
11+
def call[A](t: T[A], a: A) = t.t(a)
12+
call[Int](new TInt(), 0)
13+
}
14+
}

0 commit comments

Comments
 (0)