diff options
author | Paul Phillips <paulp@improving.org> | 2013-10-01 20:28:48 -0700 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2013-10-01 20:41:41 -0700 |
commit | 5708e9d73ba01c286d7155606b72caeab914face (patch) | |
tree | 422ca2158adb3392aa3826ea9ab9cae4a379f5ce /test/pending/neg | |
parent | 95d5554b9a263e3eb060c181463234f3e79864ab (diff) | |
download | scala-5708e9d73ba01c286d7155606b72caeab914face.tar.gz scala-5708e9d73ba01c286d7155606b72caeab914face.tar.bz2 scala-5708e9d73ba01c286d7155606b72caeab914face.zip |
SI-6680 unsoundness in gadt typing.
Introduces -Xstrict-inference to deal with the significant
gap between soundness and what presently compiles. I'm hopeful
that it's TOO strict, because it finds e.g. 75 errors compiling
immutable/IntMap.scala, but it might be that bad.
Diffstat (limited to 'test/pending/neg')
-rw-r--r-- | test/pending/neg/t6680a.scala | 13 | ||||
-rw-r--r-- | test/pending/neg/t6680b.check | 6 | ||||
-rw-r--r-- | test/pending/neg/t6680b.scala | 10 | ||||
-rw-r--r-- | test/pending/neg/t6680c.scala | 17 |
4 files changed, 0 insertions, 46 deletions
diff --git a/test/pending/neg/t6680a.scala b/test/pending/neg/t6680a.scala deleted file mode 100644 index 745334b1cd..0000000000 --- a/test/pending/neg/t6680a.scala +++ /dev/null @@ -1,13 +0,0 @@ -case class Cell[A](var x: A) -object Test { - def f1(x: Any) = x match { case y @ Cell(_) => y } // Inferred type is Cell[Any] - // def f2(x: Cell[_]) = x match { case y @ Cell(_) => y } // Inferred type is Cell[_] - // def f3[A](x: Cell[A]) = x match { case y @ Cell(_) => y } // Inferred type is Cell[A] - - def main(args: Array[String]): Unit = { - // val x = new Cell(1) - // val y = f1(x) - // y.x = "abc" - // println(x.x + 1) - } -}
\ No newline at end of file diff --git a/test/pending/neg/t6680b.check b/test/pending/neg/t6680b.check deleted file mode 100644 index a16812d91d..0000000000 --- a/test/pending/neg/t6680b.check +++ /dev/null @@ -1,6 +0,0 @@ -t6680b.scala:8: error: type mismatch; - found : String("not what you\'d expect") - required: ?Hidden1 where type ?Hidden1 (this is a GADT skolem) - case Concrete(f) => f("not what you'd expect") - ^ -one error found diff --git a/test/pending/neg/t6680b.scala b/test/pending/neg/t6680b.scala deleted file mode 100644 index e9f6468315..0000000000 --- a/test/pending/neg/t6680b.scala +++ /dev/null @@ -1,10 +0,0 @@ -trait Super[+A] -// `Hidden` must occur in both variance positions (covariant/contravariant) for the sneakiness to work -// this way type inference will infer Any for `Hidden` and `A` in the pattern below -case class Concrete[Hidden, +A](havoc: Hidden => Hidden) extends Super[A] - -object Test extends App { - (Concrete((x: Int) => x): Super[Any]) match { - case Concrete(f) => f("not what you'd expect") - } -}
\ No newline at end of file diff --git a/test/pending/neg/t6680c.scala b/test/pending/neg/t6680c.scala deleted file mode 100644 index f69663a71b..0000000000 --- a/test/pending/neg/t6680c.scala +++ /dev/null @@ -1,17 +0,0 @@ -package s - -trait Stream[+A] -case class Unfold[S,+A](s: S, f: S => Option[(A,S)]) extends Stream[A] - -object Stream { - def fromList[A](a: List[A]): Stream[A] = - Unfold(a, (l:List[A]) => l.headOption.map((_,l.tail))) -} - -object Test { - def main(args: Array[String]): Unit = { - val res = Stream.fromList(List(1,2,3,4)) - - res match { case Unfold(s, f) => f("a string!") } - } -} |