summaryrefslogtreecommitdiff
path: root/test/files/neg
diff options
context:
space:
mode:
authorAntonio Cunei <antonio.cunei@epfl.ch>2010-09-02 11:54:06 +0000
committerAntonio Cunei <antonio.cunei@epfl.ch>2010-09-02 11:54:06 +0000
commit918fb944b611ee08b5f5596c2fbc5123d2f09917 (patch)
treeb16a64b472f021b0f169ebf688b65f8492943691 /test/files/neg
parent13387444da947f6a9fa3770ec2acb227333da6cf (diff)
downloadscala-918fb944b611ee08b5f5596c2fbc5123d2f09917.tar.gz
scala-918fb944b611ee08b5f5596c2fbc5123d2f09917.tar.bz2
scala-918fb944b611ee08b5f5596c2fbc5123d2f09917.zip
Merged revisions 22108,22176-22177,22318,22589-...
Merged revisions 22108,22176-22177,22318,22589-22590,22595,22644,22657-22658,22723,22725, 22737-22738,22833-22835,22846,22858-22860,22872 via svnmerge from https://lampsvn.epfl.ch/svn-repos/scala/scala/trunk ........ r22108 | odersky | 2010-05-31 19:23:38 +0200 (Mon, 31 May 2010) | 1 line made hashset more robust for concurrent access to reduce eclipse race conditions. ........ r22176 | odersky | 2010-06-06 09:46:43 +0200 (Sun, 06 Jun 2010) | 2 lines Overwrote copyToArray for efficiency. ........ r22177 | odersky | 2010-06-06 09:47:21 +0200 (Sun, 06 Jun 2010) | 2 lines Fixed a typo in a use case ........ r22318 | odersky | 2010-06-16 17:36:08 +0200 (Wed, 16 Jun 2010) | 1 line Imporved printing of private[C] in TreePrinters. No review. ........ r22589 | odersky | 2010-07-19 15:55:09 +0200 (Mon, 19 Jul 2010) | 1 line new test files. ........ r22590 | odersky | 2010-07-19 15:56:03 +0200 (Mon, 19 Jul 2010) | 1 line Added `ask` method to compiler control to do fast trunaround computations on presentation compiler thread. ........ r22595 | odersky | 2010-07-19 17:19:45 +0200 (Mon, 19 Jul 2010) | 1 line added missing file. ........ r22644 | odersky | 2010-07-28 18:33:16 +0200 (Wed, 28 Jul 2010) | 1 line Fixes #3679. Review by milessabin. ........ r22657 | odersky | 2010-08-02 15:53:16 +0200 (Mon, 02 Aug 2010) | 1 line Revamped ScalaConversions. Fixes #3688. Also added JavaConverters object which allows for explicit asJava/asScala conversions in the scalaj style. Review by milessabin. ........ r22658 | odersky | 2010-08-02 15:53:58 +0200 (Mon, 02 Aug 2010) | 1 line Fixed some typoes/errors in doc comments. No review. ........ r22723 | odersky | 2010-08-10 17:47:15 +0200 (Tue, 10 Aug 2010) | 1 line Removed duplicate classes. No review. ........ r22725 | odersky | 2010-08-10 19:38:32 +0200 (Tue, 10 Aug 2010) | 1 line Added missing file for last checkin. ........ r22737 | odersky | 2010-08-12 11:02:46 +0200 (Thu, 12 Aug 2010) | 1 line Changes in docs and layout. No review. ........ r22738 | odersky | 2010-08-12 11:03:30 +0200 (Thu, 12 Aug 2010) | 1 line Fixed type soundness problem someone raised on hackers news. Test in override.scala. Review by moors. ........ r22833 | odersky | 2010-08-24 16:59:13 +0200 (Tue, 24 Aug 2010) | 1 line Fixes #3780. No review. ........ r22834 | odersky | 2010-08-24 16:59:54 +0200 (Tue, 24 Aug 2010) | 1 line new tests. No review. ........ r22835 | odersky | 2010-08-24 17:48:09 +0200 (Tue, 24 Aug 2010) | 1 line Closes #3776. No review. ........ r22846 | moors | 2010-08-26 18:16:54 +0200 (Thu, 26 Aug 2010) | 1 line this should fix our achy breaky build. no review ........ r22858 | odersky | 2010-08-30 17:56:13 +0200 (Mon, 30 Aug 2010) | 1 line added doc comment which makes things clearer when seen from Map or Set. ........ r22859 | odersky | 2010-08-30 17:59:05 +0200 (Mon, 30 Aug 2010) | 1 line removed author attribution, since no code from Stepan remains here. ........ r22860 | odersky | 2010-08-30 18:02:34 +0200 (Mon, 30 Aug 2010) | 1 line New wider interface of presentation compiler. Allows for partial responses and improves cancelling. See Response.scala for a usage example. ........ r22872 | odersky | 2010-08-31 17:37:55 +0200 (Tue, 31 Aug 2010) | 1 line Partial fix for #3774. The crash is gone but the program is rejected. A full fix will have to wait until a re-implementation of LUB/GLB along the lines of the DOT system. ........
Diffstat (limited to 'test/files/neg')
-rw-r--r--test/files/neg/override.check5
-rwxr-xr-xtest/files/neg/override.scala15
-rw-r--r--test/files/neg/t3774.check7
-rw-r--r--test/files/neg/t3774.scala5
-rw-r--r--test/files/neg/t3776.check4
-rw-r--r--test/files/neg/t3776.scala10
6 files changed, 46 insertions, 0 deletions
diff --git a/test/files/neg/override.check b/test/files/neg/override.check
new file mode 100644
index 0000000000..0336fb2b11
--- /dev/null
+++ b/test/files/neg/override.check
@@ -0,0 +1,5 @@
+override.scala:9: error: overriding type T in trait A with bounds >: Int <: Int;
+ type T in trait B with bounds >: String <: String has incompatible type
+ lazy val x : A with B = x
+ ^
+one error found
diff --git a/test/files/neg/override.scala b/test/files/neg/override.scala
new file mode 100755
index 0000000000..764b06603a
--- /dev/null
+++ b/test/files/neg/override.scala
@@ -0,0 +1,15 @@
+trait X {
+ trait A { type T >: Int <: Int }
+ val x : A
+ var n : x.T = 3
+}
+
+trait Y extends X {
+ trait B { type T >: String <: String }
+ lazy val x : A with B = x
+ n = "foo"
+}
+
+object Test extends Application {
+ new Y {}
+}
diff --git a/test/files/neg/t3774.check b/test/files/neg/t3774.check
new file mode 100644
index 0000000000..d73166bff9
--- /dev/null
+++ b/test/files/neg/t3774.check
@@ -0,0 +1,7 @@
+t3774.scala:4: error: overloaded method value ++ with alternatives:
+ [B1 >: List[Int]](xs: scala.collection.TraversableOnce[((Int, Int), B1)])scala.collection.immutable.Map[(Int, Int),B1] <and>
+ [B >: ((Int, Int), List[Int]),That](that: scala.collection.TraversableOnce[B])(implicit bf: scala.collection.generic.CanBuildFrom[scala.collection.immutable.Map[(Int, Int),List[Int]],B,That])That
+ cannot be applied to (scala.collection.immutable.IndexedSeq[((Int, Int), scala.collection.immutable.Range.Inclusive)])
+ Map[(Int,Int),List[Int]]() ++ (for(x <- 0 to 1 ; y <- 0 to 1) yield {(x,y)-> (0 to 1)})
+ ^
+one error found
diff --git a/test/files/neg/t3774.scala b/test/files/neg/t3774.scala
new file mode 100644
index 0000000000..2869925b01
--- /dev/null
+++ b/test/files/neg/t3774.scala
@@ -0,0 +1,5 @@
+// This used to hang the lub process. Now it rejects the file. This is still not correct,
+// but we can solve this only after a redesign of lub a la dot.
+object Hang {
+ Map[(Int,Int),List[Int]]() ++ (for(x <- 0 to 1 ; y <- 0 to 1) yield {(x,y)-> (0 to 1)})
+}
diff --git a/test/files/neg/t3776.check b/test/files/neg/t3776.check
new file mode 100644
index 0000000000..e8798df6f3
--- /dev/null
+++ b/test/files/neg/t3776.check
@@ -0,0 +1,4 @@
+t3776.scala:8: error: value someOperation is not a member of _$1
+ def parsedAs[T](v: T) = MyParser.parse(pattern, a).get someOperation v
+ ^
+one error found
diff --git a/test/files/neg/t3776.scala b/test/files/neg/t3776.scala
new file mode 100644
index 0000000000..6e368165aa
--- /dev/null
+++ b/test/files/neg/t3776.scala
@@ -0,0 +1,10 @@
+import util.parsing.combinator.{PackratParsers, RegexParsers}
+
+object MyParser extends RegexParsers with PackratParsers {
+}
+
+object Test {
+ class ParsedAs(a: String) (implicit pattern: MyParser.Parser[_]) {
+ def parsedAs[T](v: T) = MyParser.parse(pattern, a).get someOperation v
+ }
+}