summaryrefslogtreecommitdiff
path: root/test/files/run/t9387.scala
diff options
context:
space:
mode:
authorJason Zaugg <jzaugg@gmail.com>2015-07-09 14:24:30 +1000
committerJason Zaugg <jzaugg@gmail.com>2015-07-09 16:10:00 +1000
commit3bca6a23802adeb74b9524d0f80a0691fdaba441 (patch)
tree241593fb8c0fc65845d2471a008d9be8a1a82b48 /test/files/run/t9387.scala
parentb92c3aff1ab8c76c4816bd7b1a82a0f87d787837 (diff)
downloadscala-3bca6a23802adeb74b9524d0f80a0691fdaba441.tar.gz
scala-3bca6a23802adeb74b9524d0f80a0691fdaba441.tar.bz2
scala-3bca6a23802adeb74b9524d0f80a0691fdaba441.zip
SI-9387 Fix VerifyError introduced by indylambda
As with regular `Apply`-s, we should compute the generated type based on the function's type, rather than the expected type. In the test case, the expected type was void. Now, we correctly use the generated type of `scala/Function1`, which is enough to generate a subsequent POP instruction. The tree shape involved was: ``` arg0 = { { $anonfun() }; scala.runtime.BoxedUnit.UNIT } ```
Diffstat (limited to 'test/files/run/t9387.scala')
-rw-r--r--test/files/run/t9387.scala20
1 files changed, 20 insertions, 0 deletions
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