diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2015-07-27 13:31:32 +1000 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2015-07-27 13:31:32 +1000 |
commit | f2d7838d904572b3dd15a9ef223ecfd1a6e14697 (patch) | |
tree | 20d04ea95d60d936f0e48c9767e50e869704d68a /test/files/run | |
parent | 4c6dcfe9341d2db47a0b0a567f5646fb9d573020 (diff) | |
parent | 241bb9ac192f13868436d9a4e2e7ae29a2e22bed (diff) | |
download | scala-f2d7838d904572b3dd15a9ef223ecfd1a6e14697.tar.gz scala-f2d7838d904572b3dd15a9ef223ecfd1a6e14697.tar.bz2 scala-f2d7838d904572b3dd15a9ef223ecfd1a6e14697.zip |
Merge pull request #4657 from lrytz/backports
backports from 2.12.x
Diffstat (limited to 'test/files/run')
-rw-r--r-- | test/files/run/scalapInvokedynamic.check | 5 | ||||
-rw-r--r-- | test/files/run/scalapInvokedynamic.scala | 11 | ||||
-rw-r--r-- | test/files/run/t9387.scala | 20 | ||||
-rw-r--r-- | test/files/run/t9387b.check | 1 | ||||
-rw-r--r-- | test/files/run/t9387b.scala | 16 |
5 files changed, 53 insertions, 0 deletions
diff --git a/test/files/run/scalapInvokedynamic.check b/test/files/run/scalapInvokedynamic.check new file mode 100644 index 0000000000..8e4b08f234 --- /dev/null +++ b/test/files/run/scalapInvokedynamic.check @@ -0,0 +1,5 @@ +class C extends scala.AnyRef { + def this() = { /* compiled code */ } + def m: java.lang.String = { /* compiled code */ } +} + diff --git a/test/files/run/scalapInvokedynamic.scala b/test/files/run/scalapInvokedynamic.scala new file mode 100644 index 0000000000..670cf26662 --- /dev/null +++ b/test/files/run/scalapInvokedynamic.scala @@ -0,0 +1,11 @@ +class C { + def m = { + val f = (x: String) => x.trim + f(" H ae i ") + } +} + +object Test extends App { + val testClassesDir = System.getProperty("partest.output") + scala.tools.scalap.Main.main(Array("-cp", testClassesDir, "C")) +}
\ No newline at end of file diff --git a/test/files/run/t9387.scala b/test/files/run/t9387.scala new file mode 100644 index 0000000000..3e33d19fd2 --- /dev/null +++ b/test/files/run/t9387.scala @@ -0,0 +1,20 @@ +class G[T] +object G { + def v[T](x: T): G[T] = null +} + +class A[T] +object A { + def apply[T](x: => G[T]): A[T] = null +} + +object T { + A[Unit](G.v(() => ())) // Was VerifyError +} + +object Test { + def main(args: Array[String]): Unit = { + T + } + +}
\ No newline at end of file diff --git a/test/files/run/t9387b.check b/test/files/run/t9387b.check new file mode 100644 index 0000000000..6a452c185a --- /dev/null +++ b/test/files/run/t9387b.check @@ -0,0 +1 @@ +() diff --git a/test/files/run/t9387b.scala b/test/files/run/t9387b.scala new file mode 100644 index 0000000000..6339f4caba --- /dev/null +++ b/test/files/run/t9387b.scala @@ -0,0 +1,16 @@ +object T { + val f: Unit = () => () + println(f) +} + +object U { + def f[T](t: T): T = t + f[Unit](() => ()) +} + +object Test { + def main(args: Array[String]): Unit = { + T + U + } +} |