diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2015-08-10 16:40:30 +1000 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2015-08-11 14:26:23 +1000 |
commit | 4c8aab0abbd8aee05866aae9c866f3e3142c5b85 (patch) | |
tree | 594d67b40a49a68ee9d95abab7deaac11614613a /test/files | |
parent | 2f7a622e2de688f6b79bb6270020bc99445bada8 (diff) | |
download | scala-4c8aab0abbd8aee05866aae9c866f3e3142c5b85.tar.gz scala-4c8aab0abbd8aee05866aae9c866f3e3142c5b85.tar.bz2 scala-4c8aab0abbd8aee05866aae9c866f3e3142c5b85.zip |
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.
Diffstat (limited to 'test/files')
-rw-r--r-- | test/files/run/trait-default-specialize.check | 4 | ||||
-rw-r--r-- | test/files/run/trait-default-specialize.scala | 14 |
2 files changed, 18 insertions, 0 deletions
diff --git a/test/files/run/trait-default-specialize.check b/test/files/run/trait-default-specialize.check new file mode 100644 index 0000000000..aedd8c9538 --- /dev/null +++ b/test/files/run/trait-default-specialize.check @@ -0,0 +1,4 @@ +public abstract void T$mcI$sp.t(int) +public abstract void T.t(java.lang.Object) +0 +0 diff --git a/test/files/run/trait-default-specialize.scala b/test/files/run/trait-default-specialize.scala new file mode 100644 index 0000000000..7b57ddc1eb --- /dev/null +++ b/test/files/run/trait-default-specialize.scala @@ -0,0 +1,14 @@ +trait T[@specialized A] { + def t(a: A): Unit +} + +object Test { + def main(args: Array[String]): Unit = { + class TInt extends T[Int] { def t(a : Int) = println(a) } + val tMethods = classOf[TInt].getInterfaces.head.getMethods.filter(_.getName == "t") + println(tMethods.map(_.toString).sorted.mkString("\n")) + new TInt().t(0) + def call[A](t: T[A], a: A) = t.t(a) + call[Int](new TInt(), 0) + } +} |