summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/files/filters2
-rw-r--r--test/files/neg/abstract-report2.check8
-rw-r--r--test/files/neg/abstract-report2.scala6
-rw-r--r--test/files/neg/t8182.check22
-rw-r--r--test/files/neg/t8182.scala18
-rw-r--r--test/files/pos/t2066-2.10-compat.flags1
-rw-r--r--test/files/pos/t2066-2.10-compat.scala71
-rw-r--r--test/files/pos/t7919.scala6
-rw-r--r--test/files/run/macro-abort-fresh.check6
-rw-r--r--test/files/run/t6261.scala7
-rw-r--r--test/files/run/t7445.scala6
-rw-r--r--test/files/scalacheck/quasiquotes/TypeConstructionProps.scala8
12 files changed, 145 insertions, 16 deletions
diff --git a/test/files/filters b/test/files/filters
index 70d7dcff70..51a7507848 100644
--- a/test/files/filters
+++ b/test/files/filters
@@ -4,3 +4,5 @@ Java HotSpot\(TM\) .* warning:
# Hotspot receiving VM options through the $_JAVA_OPTIONS
# env variable outputs them on stderr
Picked up _JAVA_OPTIONS:
+# Filter out a message caused by this bug: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=8021205
+objc\[\d+\]: Class JavaLaunchHelper is implemented in both .* and .*\. One of the two will be used\. Which one is undefined\.
diff --git a/test/files/neg/abstract-report2.check b/test/files/neg/abstract-report2.check
index 6ea949353a..9be3d822f2 100644
--- a/test/files/neg/abstract-report2.check
+++ b/test/files/neg/abstract-report2.check
@@ -61,7 +61,7 @@ it has 13 unimplemented members.
class Baz[T] extends Collection[T]
^
-abstract-report2.scala:11: error: class Dingus needs to be abstract, since:
+abstract-report2.scala:15: error: class Dingus needs to be abstract, since:
it has 24 unimplemented members.
/** As seen from class Dingus, the missing signatures are as follows.
* For convenience, these are usable as stub implementations.
@@ -84,9 +84,6 @@ it has 24 unimplemented members.
def toIterator: Iterator[(Set[Int], String)] = ???
def toStream: Stream[(Set[Int], String)] = ???
- // Members declared in scala.math.Ordering
- def compare(x: List[Int],y: List[Int]): Int = ???
-
// Members declared in scala.collection.TraversableOnce
def copyToArray[B >: (Set[Int], String)](xs: Array[B],start: Int,len: Int): Unit = ???
def exists(p: ((Set[Int], String)) => Boolean): Boolean = ???
@@ -98,6 +95,9 @@ it has 24 unimplemented members.
def seq: scala.collection.TraversableOnce[(Set[Int], String)] = ???
def toTraversable: Traversable[(Set[Int], String)] = ???
+ // Members declared in Xyz
+ def foo(x: List[Int]): Boolean = ???
+
class Dingus extends Bippy[String, Set[Int], List[Int]]
^
four errors found
diff --git a/test/files/neg/abstract-report2.scala b/test/files/neg/abstract-report2.scala
index b6327b0766..8825340d4a 100644
--- a/test/files/neg/abstract-report2.scala
+++ b/test/files/neg/abstract-report2.scala
@@ -6,6 +6,10 @@ class Bar extends Collection[List[_ <: String]]
class Baz[T] extends Collection[T]
-trait Bippy[T1, T2, T3] extends Collection[T1] with TraversableOnce[(T2, String)] with Ordering[T3]
+trait Xyz[T] {
+ def foo(x: T): Boolean
+}
+
+trait Bippy[T1, T2, T3] extends Collection[T1] with TraversableOnce[(T2, String)] with Xyz[T3]
class Dingus extends Bippy[String, Set[Int], List[Int]] \ No newline at end of file
diff --git a/test/files/neg/t8182.check b/test/files/neg/t8182.check
new file mode 100644
index 0000000000..a156d70883
--- /dev/null
+++ b/test/files/neg/t8182.check
@@ -0,0 +1,22 @@
+t8182.scala:4: error: illegal start of simple pattern
+}
+^
+t8182.scala:7: error: illegal start of simple pattern
+}
+^
+t8182.scala:6: error: type application is not allowed in pattern
+ val a b[B] // error then continue as for X
+ ^
+t8182.scala:10: error: illegal start of simple pattern
+ case a b[B] => // bumpy recovery
+ ^
+t8182.scala:10: error: type application is not allowed in pattern
+ case a b[B] => // bumpy recovery
+ ^
+t8182.scala:11: error: '=>' expected but '}' found.
+ }
+ ^
+t8182.scala:16: error: type application is not allowed in pattern
+ case a B[T] b =>
+ ^
+7 errors found
diff --git a/test/files/neg/t8182.scala b/test/files/neg/t8182.scala
new file mode 100644
index 0000000000..1b3bc9821f
--- /dev/null
+++ b/test/files/neg/t8182.scala
@@ -0,0 +1,18 @@
+
+trait X {
+ val a b // something missing
+}
+trait Y {
+ val a b[B] // error then continue as for X
+}
+trait Z {
+ (null: Any) match {
+ case a b[B] => // bumpy recovery
+ }
+}
+object B { def unapply[W](a: Any) = Some((1,2)) }
+trait Z {
+ (null: Any) match {
+ case a B[T] b =>
+ }
+}
diff --git a/test/files/pos/t2066-2.10-compat.flags b/test/files/pos/t2066-2.10-compat.flags
new file mode 100644
index 0000000000..94c8056747
--- /dev/null
+++ b/test/files/pos/t2066-2.10-compat.flags
@@ -0,0 +1 @@
+-Xsource:2.10
diff --git a/test/files/pos/t2066-2.10-compat.scala b/test/files/pos/t2066-2.10-compat.scala
new file mode 100644
index 0000000000..fb8103e4ad
--- /dev/null
+++ b/test/files/pos/t2066-2.10-compat.scala
@@ -0,0 +1,71 @@
+import language._
+trait A1 {
+ def f[T[_]] = ()
+}
+
+trait B1 extends A1 {
+ override def f[T[+_]] = ()
+}
+
+trait C1 extends A1 {
+ override def f[T[-_]] = ()
+}
+
+
+trait A2 {
+ def f[T[+_]] = ()
+}
+
+trait B2 extends A2 {
+ override def f[T[_]] = () // okay
+}
+
+trait C2 extends A2 {
+ override def f[T[-_]] = ()
+}
+
+
+trait A3 {
+ def f[T[-_]] = ()
+}
+
+trait B3 extends A3 {
+ override def f[T[_]] = () // okay
+}
+
+trait C3 extends A3 {
+ override def f[T[-_]] = ()
+}
+
+
+trait A4 {
+ def f[T[X[+_]]] = ()
+}
+
+trait B4 extends A4 {
+ override def f[T[X[_]]] = ()
+}
+
+trait A5 {
+ def f[T[X[-_]]] = ()
+}
+
+trait B5 extends A5 {
+ override def f[T[X[_]]] = ()
+}
+
+
+
+trait A6 {
+ def f[T[X[_]]] = ()
+}
+
+trait B6 extends A6 {
+ override def f[T[X[+_]]] = () // okay
+}
+trait C6 extends A6 {
+ override def f[T[X[_]]] = () // okay
+}
+trait D6 extends A6 {
+ override def f[T[X[-_]]] = ()
+}
diff --git a/test/files/pos/t7919.scala b/test/files/pos/t7919.scala
new file mode 100644
index 0000000000..64f261ec16
--- /dev/null
+++ b/test/files/pos/t7919.scala
@@ -0,0 +1,6 @@
+
+object X {
+ val x = s""
+ val y = true
+}
+
diff --git a/test/files/run/macro-abort-fresh.check b/test/files/run/macro-abort-fresh.check
index 9fddee57d4..5064b96eef 100644
--- a/test/files/run/macro-abort-fresh.check
+++ b/test/files/run/macro-abort-fresh.check
@@ -1,6 +1,6 @@
-fresh$1
-qwe1
-qwe2
+fresh$macro$1
+qwe$macro$2
+qwe$macro$3
reflective compilation has failed:
blargh
diff --git a/test/files/run/t6261.scala b/test/files/run/t6261.scala
index b4463256c9..bf6d640de3 100644
--- a/test/files/run/t6261.scala
+++ b/test/files/run/t6261.scala
@@ -2,12 +2,6 @@ import scala.collection.immutable._
object Test extends App {
- def test0() {
- val m=ListMap(1->2,3->4)
- if(m.tail ne m.tail)
- println("ListMap.tail uses a builder, so it is not O(1)")
- }
-
def test1() {
// test that a HashTrieMap with one leaf element is not created!
val x = HashMap.empty + (1->1) + (2->2)
@@ -92,7 +86,6 @@ object Test extends App {
// StructureTests.printStructure(z)
require(z.size == 2 && z.contains(a._1) && z.contains(c._1))
}
- test0()
test1()
test2()
test3()
diff --git a/test/files/run/t7445.scala b/test/files/run/t7445.scala
new file mode 100644
index 0000000000..e4ffeb8e1a
--- /dev/null
+++ b/test/files/run/t7445.scala
@@ -0,0 +1,6 @@
+import scala.collection.immutable.ListMap
+
+object Test extends App {
+ val a = ListMap(1 -> 1, 2 -> 2, 3 -> 3, 4 -> 4, 5 -> 5);
+ require(a.tail == ListMap(2 -> 2, 3 -> 3, 4 -> 4, 5 -> 5));
+}
diff --git a/test/files/scalacheck/quasiquotes/TypeConstructionProps.scala b/test/files/scalacheck/quasiquotes/TypeConstructionProps.scala
index be7a96d91e..0984032084 100644
--- a/test/files/scalacheck/quasiquotes/TypeConstructionProps.scala
+++ b/test/files/scalacheck/quasiquotes/TypeConstructionProps.scala
@@ -28,4 +28,10 @@ object TypeConstructionProps extends QuasiquoteProperties("type construction")
val restpe = tq"C"
assert(tq"..$argtpes => $restpe" ≈ tq"(A, B) => C")
}
-} \ No newline at end of file
+
+ property("empty tq") = test {
+ val tt: TypeTree = tq" "
+ assert(tt.tpe == null)
+ assert(tt.original == null)
+ }
+}