aboutsummaryrefslogtreecommitdiff
path: root/tests/neg
diff options
context:
space:
mode:
Diffstat (limited to 'tests/neg')
-rw-r--r--tests/neg/i1992.scala9
-rw-r--r--tests/neg/i2005.scala7
2 files changed, 16 insertions, 0 deletions
diff --git a/tests/neg/i1992.scala b/tests/neg/i1992.scala
new file mode 100644
index 000000000..818b46771
--- /dev/null
+++ b/tests/neg/i1992.scala
@@ -0,0 +1,9 @@
+object Test {
+ def main(args: Array[String]) = {
+ val x: Int => Unit =
+ y => println(x) // error: `x` is a forward reference
+ implicit val z: String => Unit =
+ y => println(implicitly[String => Unit]) // error: `z` is a forward reference
+ }
+}
+
diff --git a/tests/neg/i2005.scala b/tests/neg/i2005.scala
new file mode 100644
index 000000000..fc2e4ddec
--- /dev/null
+++ b/tests/neg/i2005.scala
@@ -0,0 +1,7 @@
+
+object Test {
+ val a = 42
+ def main(args: Array[String]) = {
+ val a: Int = a // error
+ }
+}