summaryrefslogtreecommitdiff
path: root/test/files/pos
diff options
context:
space:
mode:
Diffstat (limited to 'test/files/pos')
-rw-r--r--test/files/pos/bug2018.scala15
-rw-r--r--test/files/pos/bug3097.flags2
-rw-r--r--test/files/pos/bug3278.scala15
-rw-r--r--test/files/pos/implicits.scala5
-rw-r--r--test/files/pos/spec-traits.scala83
-rw-r--r--test/files/pos/t3108.scala5
-rw-r--r--test/files/pos/t3349/AbstractTupleSet.java9
-rw-r--r--test/files/pos/t3349/Table.java9
-rw-r--r--test/files/pos/t3349/Test.scala5
-rw-r--r--test/files/pos/t3349/TupleSet.java4
10 files changed, 151 insertions, 1 deletions
diff --git a/test/files/pos/bug2018.scala b/test/files/pos/bug2018.scala
new file mode 100644
index 0000000000..1736c394c9
--- /dev/null
+++ b/test/files/pos/bug2018.scala
@@ -0,0 +1,15 @@
+class A {
+ val b = new B
+
+ def getChildren = List(new A).iterator
+
+ class B {
+ private def check = true
+
+ private def getAncestor(p: A): A = {
+ val c = (p.getChildren.find(_.b.check)) match {case Some(d) => d case None => p}
+
+ if (c == p) p else c.b.getAncestor(c)
+ }
+ }
+} \ No newline at end of file
diff --git a/test/files/pos/bug3097.flags b/test/files/pos/bug3097.flags
index 570b15929d..144ddac9d3 100644
--- a/test/files/pos/bug3097.flags
+++ b/test/files/pos/bug3097.flags
@@ -1 +1 @@
--unchecked -Yfatal-warnings
+-unchecked -Xfatal-warnings
diff --git a/test/files/pos/bug3278.scala b/test/files/pos/bug3278.scala
new file mode 100644
index 0000000000..788ec75d26
--- /dev/null
+++ b/test/files/pos/bug3278.scala
@@ -0,0 +1,15 @@
+class Foo
+class Test {
+ def update[B](x : B, b : Int) {}
+ def apply[B](x : B) = 1
+}
+
+object Test {
+ def main(a : Array[String]) {
+ val a = new Test
+ val f = new Foo
+ a(f) = 1 //works
+ a(f) = a(f) + 1 //works
+ a(f) += 1 //error: reassignment to val
+ }
+} \ No newline at end of file
diff --git a/test/files/pos/implicits.scala b/test/files/pos/implicits.scala
index 3939a28398..960c265e55 100644
--- a/test/files/pos/implicits.scala
+++ b/test/files/pos/implicits.scala
@@ -82,3 +82,8 @@ package foo2709 {
}
}
}
+
+// Problem with specs
+object specsProblem {
+ println(implicitly[Manifest[Class[_]]])
+}
diff --git a/test/files/pos/spec-traits.scala b/test/files/pos/spec-traits.scala
new file mode 100644
index 0000000000..9e339a14ad
--- /dev/null
+++ b/test/files/pos/spec-traits.scala
@@ -0,0 +1,83 @@
+trait A[@specialized(Int) T] { def foo: T }
+class B extends A[Int] { val foo = 10 }
+class C extends B
+
+// issue 3309
+class Lazy {
+ def test[U](block: => U): Unit = { block }
+
+ test { lazy val x = 1 }
+}
+
+// issue 3307
+class Bug3307 {
+ def f[Z](block: String => Z) {
+ block("abc")
+ }
+
+ ({ () =>
+ f { implicit x => println(x) } })()
+}
+
+// issue 3301
+ trait T[X]
+
+class Bug3301 {
+ def t[A]: T[A] = error("stub")
+
+ () => {
+ type X = Int
+
+ def foo[X] = t[X]
+ ()
+ }
+}
+// issue 3299
+object Failure {
+ def thunk() {
+ for (i <- 1 to 2) {
+ val Array(a, b) = Array(1,2)
+ ()
+ }
+ }
+}
+
+// issue 3296
+
+object AA
+{
+ def f(block: => Unit) {}
+
+ object BB
+ {
+ f {
+ object CC
+
+ ()
+ }
+ }
+
+ def foo[T](x: T) = { object A; false }
+}
+
+// issue 3292
+import scala.swing._
+import scala.swing.GridBagPanel._
+
+object Grid {
+
+ def later(code : => Unit) =
+ javax.swing.SwingUtilities.invokeLater(new Runnable { def run { code }})
+
+ def test = later {
+ val frame = new Dialog {
+ contents = new GridBagPanel {
+ val c = new Constraints
+ }
+ }
+ }
+
+}
+
+// issue 3325
+object O { def f[@specialized T] { for(k <- Nil: List[T]) { } } }
diff --git a/test/files/pos/t3108.scala b/test/files/pos/t3108.scala
new file mode 100644
index 0000000000..6a1da73220
--- /dev/null
+++ b/test/files/pos/t3108.scala
@@ -0,0 +1,5 @@
+object A {
+ val a: NotNull = ""
+ val b: NotNull = 41
+}
+
diff --git a/test/files/pos/t3349/AbstractTupleSet.java b/test/files/pos/t3349/AbstractTupleSet.java
new file mode 100644
index 0000000000..38e4743ef4
--- /dev/null
+++ b/test/files/pos/t3349/AbstractTupleSet.java
@@ -0,0 +1,9 @@
+public abstract class AbstractTupleSet implements TupleSet {
+ public void addColumn(String name, Class type) {
+ throw new UnsupportedOperationException();
+ }
+
+ public void addColumn(String name, String expr) {
+ throw new UnsupportedOperationException();
+ }
+}
diff --git a/test/files/pos/t3349/Table.java b/test/files/pos/t3349/Table.java
new file mode 100644
index 0000000000..1609367623
--- /dev/null
+++ b/test/files/pos/t3349/Table.java
@@ -0,0 +1,9 @@
+public class Table extends AbstractTupleSet {
+ public void addColumn(String name, Class type) {
+ throw new UnsupportedOperationException();
+ }
+
+ public void addColumn(String name, String expr) {
+ throw new UnsupportedOperationException();
+ }
+} \ No newline at end of file
diff --git a/test/files/pos/t3349/Test.scala b/test/files/pos/t3349/Test.scala
new file mode 100644
index 0000000000..8174e4c4f8
--- /dev/null
+++ b/test/files/pos/t3349/Test.scala
@@ -0,0 +1,5 @@
+object Test {
+ val label = "name"
+ val table: Table = error("")
+ table.addColumn( label, label.getClass )
+} \ No newline at end of file
diff --git a/test/files/pos/t3349/TupleSet.java b/test/files/pos/t3349/TupleSet.java
new file mode 100644
index 0000000000..14a073a950
--- /dev/null
+++ b/test/files/pos/t3349/TupleSet.java
@@ -0,0 +1,4 @@
+public interface TupleSet {
+ public void addColumn(String name, Class type);
+ public void addColumn(String name, String expr);
+} \ No newline at end of file