From 05668169eca68bbdc777fbf698f92e256f8e50a9 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Fri, 30 May 2014 14:37:40 +0200 Subject: Fix of t2504 Another problem where we need to insert an implicit on the result type of complex operation. Two additions: (1) If adapt fails, we now try with a weaker FunProto without result type, thus allowing for an additional implicit cpmversion on the result. (2) An Application in a committable context will not fail if the result type does not match the expected one. The problem will be simply deferred in that case. --- tests/untried/pos/t2500.scala | 6 ------ tests/untried/pos/t2504.scala | 5 ----- tests/untried/pos/t252.scala | 17 ----------------- tests/untried/pos/t2545.scala | 10 ---------- tests/untried/pos/t2569/Child.scala | 9 --------- tests/untried/pos/t2569/Parent.java | 13 ------------- tests/untried/pos/t2591.scala | 15 --------------- 7 files changed, 75 deletions(-) delete mode 100644 tests/untried/pos/t2500.scala delete mode 100755 tests/untried/pos/t2504.scala delete mode 100644 tests/untried/pos/t252.scala delete mode 100755 tests/untried/pos/t2545.scala delete mode 100644 tests/untried/pos/t2569/Child.scala delete mode 100644 tests/untried/pos/t2569/Parent.java delete mode 100644 tests/untried/pos/t2591.scala (limited to 'tests/untried/pos') diff --git a/tests/untried/pos/t2500.scala b/tests/untried/pos/t2500.scala deleted file mode 100644 index d0ff99a93..000000000 --- a/tests/untried/pos/t2500.scala +++ /dev/null @@ -1,6 +0,0 @@ -object Test { - import scala.collection._ - ((Map(1 -> "a", 2 -> "b"): collection.Map[Int, String]) map identity[(Int, String)]) : scala.collection.Map[Int,String] - ((SortedMap(1 -> "a", 2 -> "b"): collection.SortedMap[Int, String]) map identity[(Int, String)]): scala.collection.SortedMap[Int,String] - ((SortedSet(1, 2): collection.SortedSet[Int]) map identity[Int]): scala.collection.SortedSet[Int] -} diff --git a/tests/untried/pos/t2504.scala b/tests/untried/pos/t2504.scala deleted file mode 100755 index 67f822685..000000000 --- a/tests/untried/pos/t2504.scala +++ /dev/null @@ -1,5 +0,0 @@ -object Test { - val ys: Iterable[_] = Array("abc") - val xs = Array("abc") - xs sameElements Array("abc") -} diff --git a/tests/untried/pos/t252.scala b/tests/untried/pos/t252.scala deleted file mode 100644 index d51b5511e..000000000 --- a/tests/untried/pos/t252.scala +++ /dev/null @@ -1,17 +0,0 @@ -abstract class Module {} - -abstract class T { - type moduleType <: Module - val module: moduleType -} - -abstract class Base { - type mType = Module - type tType = T { type moduleType <: mType } -} - -abstract class Derived extends Base { - def f(inputs: List[tType]): Unit = { - for (t <- inputs; m = t.module) { } - } -} diff --git a/tests/untried/pos/t2545.scala b/tests/untried/pos/t2545.scala deleted file mode 100755 index 6ad994223..000000000 --- a/tests/untried/pos/t2545.scala +++ /dev/null @@ -1,10 +0,0 @@ -trait Frog[T] { - def hello: T - def size: Int - } - - trait OnlyWithFrogs { - self: Frog[_] => - - def sizeStr = size.toString - } diff --git a/tests/untried/pos/t2569/Child.scala b/tests/untried/pos/t2569/Child.scala deleted file mode 100644 index 64f4dc172..000000000 --- a/tests/untried/pos/t2569/Child.scala +++ /dev/null @@ -1,9 +0,0 @@ -package varargs - - class Child extends Parent { - - override def concatenate(strings: String*): String = - strings map("\"" + _ + "\"") mkString("(", ", ", ")") - - } - diff --git a/tests/untried/pos/t2569/Parent.java b/tests/untried/pos/t2569/Parent.java deleted file mode 100644 index 89421becb..000000000 --- a/tests/untried/pos/t2569/Parent.java +++ /dev/null @@ -1,13 +0,0 @@ -package varargs; - - public class Parent { - - public String concatenate(String... strings) { - StringBuilder builder = new StringBuilder(); - for (String s : strings) { - builder.append(s); - } - return builder.toString(); - } - - } diff --git a/tests/untried/pos/t2591.scala b/tests/untried/pos/t2591.scala deleted file mode 100644 index 47ae551bf..000000000 --- a/tests/untried/pos/t2591.scala +++ /dev/null @@ -1,15 +0,0 @@ -class A -class B - -object Implicits { - implicit def imp(x: A): Int = 41 - implicit def imp(x: B): Int = 41 -} - -object Test { - // should cause imp to be in scope so that the next expression type checks - // `import Implicits._` works - import Implicits.imp - - (new A) : Int -} -- cgit v1.2.3