diff options
author | Martin Odersky <odersky@gmail.com> | 2014-05-30 14:37:40 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2014-05-30 14:37:40 +0200 |
commit | 05668169eca68bbdc777fbf698f92e256f8e50a9 (patch) | |
tree | da628f1f17fbc30e0183c95546caad4cef2f4039 /tests | |
parent | 3b247c34a4c8959b638c61b116635d6c7e80403a (diff) | |
download | dotty-05668169eca68bbdc777fbf698f92e256f8e50a9.tar.gz dotty-05668169eca68bbdc777fbf698f92e256f8e50a9.tar.bz2 dotty-05668169eca68bbdc777fbf698f92e256f8e50a9.zip |
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.
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/pos/t2504.scala (renamed from tests/untried/pos/t2504.scala) | 1 | ||||
-rw-r--r-- | tests/pos/test.scala | 6 | ||||
-rw-r--r-- | tests/untried/pos/t2500.scala | 6 | ||||
-rw-r--r-- | tests/untried/pos/t252.scala | 17 | ||||
-rwxr-xr-x | tests/untried/pos/t2545.scala | 10 | ||||
-rw-r--r-- | tests/untried/pos/t2569/Child.scala | 9 | ||||
-rw-r--r-- | tests/untried/pos/t2569/Parent.java | 13 | ||||
-rw-r--r-- | tests/untried/pos/t2591.scala | 15 |
8 files changed, 1 insertions, 76 deletions
diff --git a/tests/untried/pos/t2504.scala b/tests/pos/t2504.scala index 67f822685..72117174c 100755 --- a/tests/untried/pos/t2504.scala +++ b/tests/pos/t2504.scala @@ -1,4 +1,5 @@ object Test { + val zs = Array("abc") val ys: Iterable[_] = Array("abc") val xs = Array("abc") xs sameElements Array("abc") diff --git a/tests/pos/test.scala b/tests/pos/test.scala deleted file mode 100644 index 71fa1b1d9..000000000 --- a/tests/pos/test.scala +++ /dev/null @@ -1,6 +0,0 @@ -object test { - - val m = new java.util.HashMap[String, String] - m.size - -}
\ No newline at end of file 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/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 -} |