summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/files/run/t9387.scala20
-rw-r--r--test/files/run/t9387b.check1
-rw-r--r--test/files/run/t9387b.scala16
3 files changed, 37 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
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
+ }
+}