diff options
author | Adriaan Moors <adriaan.moors@epfl.ch> | 2012-05-21 08:16:36 -0700 |
---|---|---|
committer | Adriaan Moors <adriaan.moors@epfl.ch> | 2012-05-21 08:16:36 -0700 |
commit | 4b01e1ff3dbe383be5a3f80747a5b7113b6e9521 (patch) | |
tree | b0f1c83132223b6f98e9a1ce576f83ccf91798b7 /test/files/run/t5125b.scala | |
parent | 08334b0721d6040d61a727702b718fb3f3d558d2 (diff) | |
parent | dbee14fba95480cc8dddeefde573444551827b30 (diff) | |
download | scala-4b01e1ff3dbe383be5a3f80747a5b7113b6e9521.tar.gz scala-4b01e1ff3dbe383be5a3f80747a5b7113b6e9521.tar.bz2 scala-4b01e1ff3dbe383be5a3f80747a5b7113b6e9521.zip |
Merge pull request #587 from retronym/ticket/5125
Fix @varargs forwarder generation in the presence of nested templates.
Diffstat (limited to 'test/files/run/t5125b.scala')
-rw-r--r-- | test/files/run/t5125b.scala | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/test/files/run/t5125b.scala b/test/files/run/t5125b.scala new file mode 100644 index 0000000000..29c08fee4c --- /dev/null +++ b/test/files/run/t5125b.scala @@ -0,0 +1,37 @@ +class C1 { + @scala.annotation.varargs + def f(values:String*) = println("Calling C1.f(): " + values) +} + +class C2 { + @scala.annotation.varargs + def f(values:String*) = println("Calling C2.f(): " + values) + def g(): String => Int = s => s.hashCode + + class C3 { + @scala.annotation.varargs + def f(values:String*) = println("Calling C3.f(): " + values) + } +} + +class C4 { + def f(values: String*) = println("Calling C4.f(): " + values) + + locally { + @scala.annotation.varargs + def f(values: String*) = println("Calling C4.<locally>.f(): " + values) + } +} + +object Test extends App { + def check(c: Class[_]) { + val methodName = "f" + val methods = c.getDeclaredMethods.filter(_.getName == methodName) + println(methods.map(_.toString).sorted.mkString("\n")) + } + + check(classOf[C1]) + check(classOf[C2]) + check(classOf[C2#C3]) + check(classOf[C4]) +} |