diff options
author | Adriaan Moors <adriaan@lightbend.com> | 2017-01-10 16:33:37 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-01-10 16:33:37 -0800 |
commit | a5d38ea33430e144d05e7486791f70e144c5b602 (patch) | |
tree | 18b1458795b529dd1331b84231e8a8add0946fa3 /test/files/run | |
parent | 36967321c7a8a99cab2f9f1c4c0c46f09d3d34a6 (diff) | |
parent | 359b0bce8ec9bced0ca6fbb3865e9b3a6bcb30b4 (diff) | |
download | scala-a5d38ea33430e144d05e7486791f70e144c5b602.tar.gz scala-a5d38ea33430e144d05e7486791f70e144c5b602.tar.bz2 scala-a5d38ea33430e144d05e7486791f70e144c5b602.zip |
Merge pull request #5630 from adriaanm/rebase-5557
[backport] SI-10071 SI-8786 varargs methods
Diffstat (limited to 'test/files/run')
-rw-r--r-- | test/files/run/reflection-mem-typecheck.scala | 26 | ||||
-rw-r--r-- | test/files/run/t5125b.check | 3 | ||||
-rw-r--r-- | test/files/run/t5125b.scala | 12 |
3 files changed, 15 insertions, 26 deletions
diff --git a/test/files/run/reflection-mem-typecheck.scala b/test/files/run/reflection-mem-typecheck.scala deleted file mode 100644 index f1fe983ede..0000000000 --- a/test/files/run/reflection-mem-typecheck.scala +++ /dev/null @@ -1,26 +0,0 @@ -import scala.tools.partest.MemoryTest - -trait A { type T <: A } -trait B { type T <: B } - -object Test extends MemoryTest { - lazy val tb = { - import scala.reflect.runtime.universe._ - import scala.reflect.runtime.{currentMirror => cm} - import scala.tools.reflect.ToolBox - cm.mkToolBox() - } - - override def maxDelta = 12 - override def calcsPerIter = 8 - override def calc() { - var snippet = """ - trait A { type T <: A } - trait B { type T <: B } - def foo[T](x: List[T]) = x - foo(List(new A {}, new B {})) - """.trim - snippet = snippet + "\n" + (List.fill(50)(snippet.split("\n").last) mkString "\n") - tb.typecheck(tb.parse(snippet)) - } -}
\ No newline at end of file diff --git a/test/files/run/t5125b.check b/test/files/run/t5125b.check index ddbf908f04..29b438a2d6 100644 --- a/test/files/run/t5125b.check +++ b/test/files/run/t5125b.check @@ -5,3 +5,6 @@ public void C2.f(scala.collection.Seq) public void C2$C3.f(java.lang.String[]) public void C2$C3.f(scala.collection.Seq) public void C4.f(scala.collection.Seq) +private void C5.f(int,int[]) +private void C5.f(int,scala.collection.Seq) +public void C5.f(scala.collection.Seq) diff --git a/test/files/run/t5125b.scala b/test/files/run/t5125b.scala index 149c49e213..60ab1d9792 100644 --- a/test/files/run/t5125b.scala +++ b/test/files/run/t5125b.scala @@ -23,6 +23,17 @@ class C4 { } } +class C5 { + def f(values: String*) = println("Calling C5.f(): " + values) + @scala.annotation.varargs + private def f(v: Int, values: Int*) = println("Calling C5.f(): " + values) + + def method(): Unit = { + @scala.annotation.varargs + def f(values: String*) = println("Calling C5.<locally>.f(): " + values) + } +} + object Test extends App { def check(c: Class[_]) { val methodName = "f" @@ -34,4 +45,5 @@ object Test extends App { check(classOf[C2]) check(classOf[C2#C3]) check(classOf[C4]) + check(classOf[C5]) } |