diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/neg/i1706.scala | 3 | ||||
-rw-r--r-- | tests/pos/i2071.scala | 7 | ||||
-rw-r--r-- | tests/run/i2077.check | 1 | ||||
-rw-r--r-- | tests/run/i2077.scala | 10 |
4 files changed, 21 insertions, 0 deletions
diff --git a/tests/neg/i1706.scala b/tests/neg/i1706.scala new file mode 100644 index 000000000..b55ff6e2d --- /dev/null +++ b/tests/neg/i1706.scala @@ -0,0 +1,3 @@ +object Test { + println (Object.reflect.runtime.universe.reify (new Object().getClass)) // error: not found Object +} diff --git a/tests/pos/i2071.scala b/tests/pos/i2071.scala new file mode 100644 index 000000000..1855dccf4 --- /dev/null +++ b/tests/pos/i2071.scala @@ -0,0 +1,7 @@ +object Test { + type PF[A, B] = PartialFunction[A, B] + + val f: PF[Int, String] = { + case i => "bar" + } +}
\ No newline at end of file diff --git a/tests/run/i2077.check b/tests/run/i2077.check new file mode 100644 index 000000000..45b983be3 --- /dev/null +++ b/tests/run/i2077.check @@ -0,0 +1 @@ +hi diff --git a/tests/run/i2077.scala b/tests/run/i2077.scala new file mode 100644 index 000000000..42b629b90 --- /dev/null +++ b/tests/run/i2077.scala @@ -0,0 +1,10 @@ +object Test { + inline val x = true + val y = if (x) 1 else 2 // reduced to val y = 1 + + def main(args: Array[String]): Unit = + if ({ println("hi"); true }) // cannot be reduced + 1 + else + 2 +} |