From 2da43052f0f0ff04c500c074ee429a6d713a6a2d Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Sat, 18 Feb 2017 13:12:26 +0100 Subject: Fix off-by-one error in forward reference checking --- tests/neg/i1992.scala | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 tests/neg/i1992.scala (limited to 'tests/neg') 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 + } +} + -- cgit v1.2.3 From 815e426c8512e046f09edb7c7d3c3a98653bce24 Mon Sep 17 00:00:00 2001 From: Nicolas Stucki Date: Tue, 21 Feb 2017 09:32:28 +0100 Subject: Fixed #2005: Add test case. --- tests/neg/i2005.scala | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 tests/neg/i2005.scala (limited to 'tests/neg') 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 + } +} -- cgit v1.2.3