summaryrefslogtreecommitdiff
path: root/test/files/run/t7932.scala
diff options
context:
space:
mode:
authorJason Zaugg <jzaugg@gmail.com>2016-06-06 14:24:38 +1000
committerAdriaan Moors <adriaan.moors@typesafe.com>2016-06-28 09:18:34 -0700
commit7d51b3fd1569917cb804363bd418466a306f5c89 (patch)
treeede84e6a0dda8750276d7c0986ffc6d15c9fb1dc /test/files/run/t7932.scala
parent91b066aac5edf53ca18603f8486eb255514b3118 (diff)
downloadscala-7d51b3fd1569917cb804363bd418466a306f5c89.tar.gz
scala-7d51b3fd1569917cb804363bd418466a306f5c89.tar.bz2
scala-7d51b3fd1569917cb804363bd418466a306f5c89.zip
Emit trait method bodies in statics
And use this as the target of the default methods or statically resolved super or $init calls. The call-site change is predicated on `-Yuse-trait-statics` as a stepping stone for experimentation / bootstrapping. I have performed this transformation in the backend, rather than trying to reflect this in the view from Scala symbols + ASTs. We also need to add an restriction related to invokespecial to Java parents: to support a super call to one of these to implement a super accessor, the interface must be listed as a direct parent of the class. The static method names has a trailing $ added to avoid duplicate name and signature errors in classfiles.
Diffstat (limited to 'test/files/run/t7932.scala')
-rw-r--r--test/files/run/t7932.scala10
1 files changed, 6 insertions, 4 deletions
diff --git a/test/files/run/t7932.scala b/test/files/run/t7932.scala
index e6bdbf2417..40b0b9989b 100644
--- a/test/files/run/t7932.scala
+++ b/test/files/run/t7932.scala
@@ -17,12 +17,14 @@ trait M2[F] { self: M1[F] =>
abstract class C extends M1[Float] with M2[Float]
-object Test extends App {
+object Test {
def t(c: Class[_]) = {
val ms = c.getMethods.filter(_.getName.startsWith("category"))
println(ms.map(_.toGenericString).sorted.mkString("\n"))
}
- t(classOf[C])
- t(classOf[M1[_]])
- t(classOf[M2[_]])
+ def main(args: Array[String]) {
+ t(classOf[C])
+ t(classOf[M1[_]])
+ t(classOf[M2[_]])
+ }
}