summaryrefslogtreecommitdiff
path: root/test/files/pos
diff options
context:
space:
mode:
authorAleksandar Prokopec <axel22@gmail.com>2012-06-28 19:48:31 +0200
committerAleksandar Prokopec <axel22@gmail.com>2012-06-28 19:48:31 +0200
commitb379ff4f59c139ff7d2b77e7e808f0b74aa9f268 (patch)
treed531663cc08c71cc2631c119403af3032c71b543 /test/files/pos
parent2f0d94c02ab328a3f8da25b5ab8f402a68143af3 (diff)
parent6f08c06a35a0b70c49e23a296b13ac391a460584 (diff)
downloadscala-b379ff4f59c139ff7d2b77e7e808f0b74aa9f268.tar.gz
scala-b379ff4f59c139ff7d2b77e7e808f0b74aa9f268.tar.bz2
scala-b379ff4f59c139ff7d2b77e7e808f0b74aa9f268.zip
Merge branch 'master' into issue/5846,4597,4027,4112
Conflicts: src/library/scala/collection/MapLike.scala src/library/scala/collection/SortedMapLike.scala
Diffstat (limited to 'test/files/pos')
-rw-r--r--test/files/pos/rangepos-anonapply.flags1
-rw-r--r--test/files/pos/rangepos-anonapply.scala9
-rw-r--r--test/files/pos/spec-params-new.scala2
-rw-r--r--test/files/pos/t4842.scala26
-rw-r--r--test/files/pos/t5899.flags1
-rw-r--r--test/files/pos/t5899.scala19
-rw-r--r--test/files/pos/t5910.java2
-rw-r--r--test/files/pos/t5953.scala16
-rw-r--r--test/files/pos/t5968.flags1
-rw-r--r--test/files/pos/t5968.scala8
10 files changed, 84 insertions, 1 deletions
diff --git a/test/files/pos/rangepos-anonapply.flags b/test/files/pos/rangepos-anonapply.flags
new file mode 100644
index 0000000000..281f0a10cd
--- /dev/null
+++ b/test/files/pos/rangepos-anonapply.flags
@@ -0,0 +1 @@
+-Yrangepos
diff --git a/test/files/pos/rangepos-anonapply.scala b/test/files/pos/rangepos-anonapply.scala
new file mode 100644
index 0000000000..2f3e4ad6cd
--- /dev/null
+++ b/test/files/pos/rangepos-anonapply.scala
@@ -0,0 +1,9 @@
+class Test {
+ trait PropTraverser {
+ def apply(x: Int): Unit = {}
+ }
+
+ def gather(x: Int) {
+ (new PropTraverser {})(x)
+ }
+}
diff --git a/test/files/pos/spec-params-new.scala b/test/files/pos/spec-params-new.scala
index 661e686f0e..959ce1591c 100644
--- a/test/files/pos/spec-params-new.scala
+++ b/test/files/pos/spec-params-new.scala
@@ -31,4 +31,4 @@ class Foo[@specialized A: ClassTag] {
val xs = new Array[A](1)
xs(0) = x
}
-} \ No newline at end of file
+}
diff --git a/test/files/pos/t4842.scala b/test/files/pos/t4842.scala
new file mode 100644
index 0000000000..17ff684833
--- /dev/null
+++ b/test/files/pos/t4842.scala
@@ -0,0 +1,26 @@
+class Foo (x: AnyRef) {
+ def this() = {
+ this(new { } ) // okay
+ }
+}
+
+
+class Blerg (x: AnyRef) {
+ def this() = {
+ this(new { class Bar { println(Bar.this); new { println(Bar.this) } }; new Bar } ) // okay
+ }
+}
+
+
+class Outer {
+ class Inner (x: AnyRef) {
+ def this() = {
+ this(new { class Bar { println(Bar.this); new { println(Bar.this) } }; new Bar } ) // okay
+ }
+
+ def this(x: Boolean) = {
+ this(new { println(Outer.this) } ) // okay
+ }
+ }
+}
+
diff --git a/test/files/pos/t5899.flags b/test/files/pos/t5899.flags
new file mode 100644
index 0000000000..e8fb65d50c
--- /dev/null
+++ b/test/files/pos/t5899.flags
@@ -0,0 +1 @@
+-Xfatal-warnings \ No newline at end of file
diff --git a/test/files/pos/t5899.scala b/test/files/pos/t5899.scala
new file mode 100644
index 0000000000..b16f1f84fe
--- /dev/null
+++ b/test/files/pos/t5899.scala
@@ -0,0 +1,19 @@
+import scala.tools.nsc._
+
+trait Foo {
+ val global: Global
+ import global.{Name, Symbol, nme}
+
+ case class Bippy(name: Name)
+
+ def f(x: Bippy, sym: Symbol): Int = {
+ // no warning (!) for
+ // val Stable = sym.name.toTermName
+
+ val Stable = sym.name
+ Bippy(Stable) match {
+ case Bippy(nme.WILDCARD) => 1
+ case Bippy(Stable) => 2 // should not be considered unreachable
+ }
+ }
+} \ No newline at end of file
diff --git a/test/files/pos/t5910.java b/test/files/pos/t5910.java
new file mode 100644
index 0000000000..e007a1fbb5
--- /dev/null
+++ b/test/files/pos/t5910.java
@@ -0,0 +1,2 @@
+class Foo {
+};;;;;;; \ No newline at end of file
diff --git a/test/files/pos/t5953.scala b/test/files/pos/t5953.scala
new file mode 100644
index 0000000000..90e7d84646
--- /dev/null
+++ b/test/files/pos/t5953.scala
@@ -0,0 +1,16 @@
+import scala.collection.{ mutable, immutable, generic, GenTraversableOnce }
+
+package object foo {
+ @inline implicit class TravOps[A, CC[A] <: GenTraversableOnce[A]](val coll: CC[A]) extends AnyVal {
+ def build[CC2[X]](implicit cbf: generic.CanBuildFrom[Nothing, A, CC2[A]]): CC2[A] = {
+ cbf() ++= coll.toIterator result
+ }
+ }
+}
+
+package foo {
+ object Test {
+ def f1[T](xs: Traversable[T]) = xs.convertTo[immutable.Vector]
+ def f2[T](xs: Traversable[T]) = xs.build[immutable.Vector]
+ }
+}
diff --git a/test/files/pos/t5968.flags b/test/files/pos/t5968.flags
new file mode 100644
index 0000000000..e8fb65d50c
--- /dev/null
+++ b/test/files/pos/t5968.flags
@@ -0,0 +1 @@
+-Xfatal-warnings \ No newline at end of file
diff --git a/test/files/pos/t5968.scala b/test/files/pos/t5968.scala
new file mode 100644
index 0000000000..0093f84fc0
--- /dev/null
+++ b/test/files/pos/t5968.scala
@@ -0,0 +1,8 @@
+object X {
+ def f(e: Either[Int, X.type]) = e match {
+ case Left(i) => i
+ case Right(X) => 0
+ // SI-5986 spurious exhaustivity warning here
+ }
+}
+