From d2120ca8accb7d6b8438431931c84870e835512c Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Mon, 1 Aug 2016 14:37:57 +0200 Subject: Suspend interpolating typevars when there are unreported errors. Interpolating typevars that appear co- or contra-variantly in a type is a cleanup measure - it helps keep the constraint set small. However, if there are uneported errors, some of these errors might report on unsatisfiable constraints for these type variables. In that case, instantiating the type variables risks being confusing. --- tests/neg/i1430.scala | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 tests/neg/i1430.scala (limited to 'tests') diff --git a/tests/neg/i1430.scala b/tests/neg/i1430.scala new file mode 100644 index 000000000..870780695 --- /dev/null +++ b/tests/neg/i1430.scala @@ -0,0 +1,8 @@ +object Test { + + val x: List[String] = List(1) // error: found Int(1), expected: String + + val y: List[List[String]] = List(List(1)) // error: found Int(1), expected: String + + val z: (List[String], List[Int]) = (List(1), List("a")) // error: found Int(1), expected: String // error: found String(a), expected: Int +} -- cgit v1.2.3