From 130e9a20755d512b47ca0fe41d8dfc3f6879cf86 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Tue, 27 Jan 2015 11:13:54 +0100 Subject: Use normnalized type to report type errors. Without it, we get strange error messages like found: (implicit X)Y requred: Z when the problem is really that Y is not a subtype of Z. --- tests/pending/pos/t3020.scala | 9 --------- tests/pending/pos/t3037.scala | 13 ------------- tests/pending/pos/t304.scala | 5 ----- tests/pending/pos/t3106.scala | 7 ------- tests/pending/pos/t3137.scala | 17 ----------------- tests/pending/pos/t3152.scala | 20 -------------------- tests/pending/pos/t3174.scala | 14 -------------- tests/pending/pos/t3177.scala | 39 --------------------------------------- 8 files changed, 124 deletions(-) delete mode 100644 tests/pending/pos/t3020.scala delete mode 100644 tests/pending/pos/t3037.scala delete mode 100644 tests/pending/pos/t304.scala delete mode 100644 tests/pending/pos/t3106.scala delete mode 100644 tests/pending/pos/t3137.scala delete mode 100644 tests/pending/pos/t3152.scala delete mode 100755 tests/pending/pos/t3174.scala delete mode 100644 tests/pending/pos/t3177.scala (limited to 'tests') diff --git a/tests/pending/pos/t3020.scala b/tests/pending/pos/t3020.scala deleted file mode 100644 index 016563e27..000000000 --- a/tests/pending/pos/t3020.scala +++ /dev/null @@ -1,9 +0,0 @@ -object Test { - def main(args: Array[String]): Unit = { - var x = true - - ( { if (x) new scala.util.Random() } .asInstanceOf[Runnable] ) - } -} - - diff --git a/tests/pending/pos/t3037.scala b/tests/pending/pos/t3037.scala deleted file mode 100644 index b71ffe041..000000000 --- a/tests/pending/pos/t3037.scala +++ /dev/null @@ -1,13 +0,0 @@ -package test - -object A { - println(("a" match { - case "a" => 1 - case _ => "a" - }).asInstanceOf[Object]) - def foo[T](x: T) = x - var x: Int = 1 - var y: Long = 1L - x = foo(x) - y = foo(y) -} diff --git a/tests/pending/pos/t304.scala b/tests/pending/pos/t304.scala deleted file mode 100644 index 76da44157..000000000 --- a/tests/pending/pos/t304.scala +++ /dev/null @@ -1,5 +0,0 @@ -object O { - def f1 = -1; - def f2 = 0-1; - def f3 = -f1; -} diff --git a/tests/pending/pos/t3106.scala b/tests/pending/pos/t3106.scala deleted file mode 100644 index a9591d0aa..000000000 --- a/tests/pending/pos/t3106.scala +++ /dev/null @@ -1,7 +0,0 @@ -class Sample[A] (val d0: ((A,A)) => A) {} - -object Sample { - implicit def apply[A] (x:A): Sample[A] = { - new Sample(p => p._1) - } -} diff --git a/tests/pending/pos/t3137.scala b/tests/pending/pos/t3137.scala deleted file mode 100644 index cb7317af0..000000000 --- a/tests/pending/pos/t3137.scala +++ /dev/null @@ -1,17 +0,0 @@ -trait A { - val C: Any -} - -class B extends A { - class C - object C -} - -trait AA { - type C - def C: Int => C -} - -class BB extends AA { - case class C(v: Int) -} diff --git a/tests/pending/pos/t3152.scala b/tests/pending/pos/t3152.scala deleted file mode 100644 index 3d1dcbd6f..000000000 --- a/tests/pending/pos/t3152.scala +++ /dev/null @@ -1,20 +0,0 @@ -trait Applicative[M[_]] - -sealed trait MA[M[_], A] { - def sequence[N[_], B](implicit a: A <:< N[B], n: Applicative[N]): N[M[B]] = sys.error("stub") - // def sequence3[N[_], B]()(implicit a: A <:< N[B], n: Applicative[N]): N[M[B]] = sys.error("stub") -} - -object test { - implicit def ListMA[A](l: List[A]): MA[List, A] = sys.error("stub") - implicit val ao: Applicative[Option] = sys.error("stub") - - /* This compiles OK: - (Nil: List[Option[Int]]).sequence3(): Option[List[Int]] - */ - - // BUG: error: immutable is not an enclosing class - // !!! No line number is reported with the error - (Nil: List[Option[Int]]).sequence: Option[List[Int]] - (List[Option[Int]]()).sequence: Option[List[Int]] -} diff --git a/tests/pending/pos/t3174.scala b/tests/pending/pos/t3174.scala deleted file mode 100755 index 8d9b2578d..000000000 --- a/tests/pending/pos/t3174.scala +++ /dev/null @@ -1,14 +0,0 @@ -object test { - def method(): Unit = { - class Foo extends AnyRef { - object Color { - object Blue - } - - class Board { - val grid = Color.Blue - } - } - new Foo - } - } diff --git a/tests/pending/pos/t3177.scala b/tests/pending/pos/t3177.scala deleted file mode 100644 index 12dfce6ee..000000000 --- a/tests/pending/pos/t3177.scala +++ /dev/null @@ -1,39 +0,0 @@ -trait InvariantFunctor[F[_]] { - def xmap[A, B](ma: F[A], f: A => B, g: B => A): F[B] -} - -object InvariantFunctor { - import Endo._ - - implicit val EndoInvariantFunctor: InvariantFunctor[Endo] = new InvariantFunctor[Endo] { - def xmap[A, B](ma: Endo[A], f: A => B, g: B => A): Endo[B] = (b: B) => f(ma(g(b))) - } - - // The definition about fails with: - // anon-type.scala:9: error: not found: value b - // def xmap[A, B](ma: Endo[A], f: A => B, g: B => A): Endo[B] = (b: B) => f(ma(g(b))) - // ^ - // anon-type.scala:8: error: not found: type $anon - // implicit val EndoInvariantFunctor = new InvariantFunctor[Endo] { - // ^ - - - // These both work: - // implicit val EndoInvariantFunctorAscribed: InvariantFunctor[Endo] = new InvariantFunctor[Endo] { - // def xmap[A, B](ma: Endo[A], f: A => B, g: B => A): Endo[B] = (b: B) => f(ma(g(b))) - // } - // - // implicit val EndoInvariantFunctorStubbed = new InvariantFunctor[Endo] { - // def xmap[A, B](ma: Endo[A], f: A => B, g: B => A): Endo[B] = error("stub") - // } -} - -trait Endo[X] - -object Endo { - implicit def EndoTo[A](f: A => A): Endo[A] = new Endo[A] { - def apply(a: A) = f(a) - } - - implicit def EndoFrom[A](e: Endo[A]): A => A = e.apply(_) -} -- cgit v1.2.3