aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2015-01-27 12:46:48 +0100
committerMartin Odersky <odersky@gmail.com>2015-02-07 17:31:53 +0100
commit1f8b5691dabaae336c3c3f568b303eb24e783494 (patch)
tree7546b2148b5863e2e0070122ffc6d67eacf9edf4
parent4320e20ff5f3126940f0ecad1dd53573cf03562b (diff)
downloaddotty-1f8b5691dabaae336c3c3f568b303eb24e783494.tar.gz
dotty-1f8b5691dabaae336c3c3f568b303eb24e783494.tar.bz2
dotty-1f8b5691dabaae336c3c3f568b303eb24e783494.zip
Test reorg
-rw-r--r--test/dotc/tests.scala2
-rw-r--r--tests/disabled/not-representable/pos/t3498-old.scala (renamed from tests/pending/pos/t3498-old.scala)0
-rw-r--r--tests/disabled/structural-type/pos/t3175-pos.scala (renamed from tests/pending/pos/t3175-pos.scala)0
-rw-r--r--tests/disabled/structural-type/pos/t3363-new.scala (renamed from tests/pending/pos/t3363-new.scala)2
-rw-r--r--tests/disabled/structural-type/pos/t3363-old.scala (renamed from tests/pending/pos/t3363-old.scala)2
-rw-r--r--tests/neg/overrides.scala21
-rw-r--r--tests/pending/pos/self-type-override.scala13
-rw-r--r--tests/pending/pos/t3278.scala15
-rw-r--r--tests/pending/pos/t3480.scala2
-rw-r--r--tests/pos/sammy_poly.scala (renamed from tests/pending/pos/sammy_poly.scala)0
-rw-r--r--tests/pos/scoping1.scala (renamed from tests/pending/pos/scoping1.scala)2
-rw-r--r--tests/pos/sealed-final.scala (renamed from tests/pending/pos/sealed-final.scala)0
-rw-r--r--tests/pos/spec-sealed.scala (renamed from tests/pending/pos/spec-sealed.scala)0
-rw-r--r--tests/pos/subtyping.scala29
-rw-r--r--tests/pos/t319.scala (renamed from tests/pending/pos/t319.scala)3
-rw-r--r--tests/pos/t3278.scala30
-rw-r--r--tests/pos/t3343.scala (renamed from tests/pending/pos/t3343.scala)0
-rw-r--r--tests/pos/t3411.scala (renamed from tests/pending/pos/t3411.scala)0
-rw-r--r--tests/pos/t344.scala (renamed from tests/pending/pos/t344.scala)0
19 files changed, 59 insertions, 62 deletions
diff --git a/test/dotc/tests.scala b/test/dotc/tests.scala
index 89ac2b6c4..3a863f013 100644
--- a/test/dotc/tests.scala
+++ b/test/dotc/tests.scala
@@ -83,7 +83,7 @@ class tests extends CompilerTest {
@Test def neg_autoTupling2 = compileFile(negDir, "autoTuplingTest", xerrors = 4)
@Test def neg_companions = compileFile(negDir, "companions", xerrors = 1)
@Test def neg_over = compileFile(negDir, "over", xerrors = 1)
- @Test def neg_overrides = compileFile(negDir, "overrides", xerrors = 7)
+ @Test def neg_overrides = compileFile(negDir, "overrides", xerrors = 8)
@Test def neg_projections = compileFile(negDir, "projections", xerrors = 1)
@Test def neg_i39 = compileFile(negDir, "i39", xerrors = 1)
@Test def neg_i50_volatile = compileFile(negDir, "i50-volatile", xerrors = 4)
diff --git a/tests/pending/pos/t3498-old.scala b/tests/disabled/not-representable/pos/t3498-old.scala
index 118a8d849..118a8d849 100644
--- a/tests/pending/pos/t3498-old.scala
+++ b/tests/disabled/not-representable/pos/t3498-old.scala
diff --git a/tests/pending/pos/t3175-pos.scala b/tests/disabled/structural-type/pos/t3175-pos.scala
index 89bbf8b5f..89bbf8b5f 100644
--- a/tests/pending/pos/t3175-pos.scala
+++ b/tests/disabled/structural-type/pos/t3175-pos.scala
diff --git a/tests/pending/pos/t3363-new.scala b/tests/disabled/structural-type/pos/t3363-new.scala
index f935cfe1a..835d9471b 100644
--- a/tests/pending/pos/t3363-new.scala
+++ b/tests/disabled/structural-type/pos/t3363-new.scala
@@ -7,7 +7,7 @@ object TestCase {
//if fs was reduced to List (generic type with one parameter) then the code compiles
//if you inherit from MapOps[T] instead of MapOps[F] then code compiles fine
- implicit def map2ops[T,F](fs: Map[T,F]): TestCase.MapOps[F]{lazy val m: reflect.runtime.universe.TypeTag[T]; def is(xs: List[T]): List[List[T]]} = new MapOps[F] {
+ implicit def map2ops[T,F](fs: Map[T,F]): TestCase.MapOps[F]{val m: reflect.runtime.universe.TypeTag[T]; def is(xs: List[T]): List[List[T]]} = new MapOps[F] {
//if you remove this line, then code compiles
lazy val m: TypeTag[T] = sys.error("just something to make it compile")
def is(xs: List[T]) = List(xs)
diff --git a/tests/pending/pos/t3363-old.scala b/tests/disabled/structural-type/pos/t3363-old.scala
index 8e54d4b4a..0088eff3d 100644
--- a/tests/pending/pos/t3363-old.scala
+++ b/tests/disabled/structural-type/pos/t3363-old.scala
@@ -5,7 +5,7 @@ object TestCase {
//if fs was reduced to List (generic type with one parameter) then the code compiles
//if you inherit from MapOps[T] instead of MapOps[F] then code compiles fine
- implicit def map2ops[T,F](fs: Map[T,F]): TestCase.MapOps[F]{lazy val m: Manifest[T]; def is(xs: List[T]): List[List[T]]} = new MapOps[F] {
+ implicit def map2ops[T,F](fs: Map[T,F]): TestCase.MapOps[F]{val m: Manifest[T]; def is(xs: List[T]): List[List[T]]} = new MapOps[F] {
//if you remove this line, then code compiles
lazy val m: Manifest[T] = sys.error("just something to make it compile")
def is(xs: List[T]) = List(xs)
diff --git a/tests/neg/overrides.scala b/tests/neg/overrides.scala
index 943cc8bc4..cffb5480a 100644
--- a/tests/neg/overrides.scala
+++ b/tests/neg/overrides.scala
@@ -79,3 +79,24 @@ class Y2 extends X2 {
class X3 {
override type T = A1
}
+
+package p3 {
+
+// Dotty change of rules: Toverrider#f does not
+// override TCommon#f, hence the accidental override rule
+// applies.
+trait TCommon {
+ def f: String
+}
+
+class C1 extends TCommon {
+ def f = "in C1"
+}
+
+trait TOverrider { this: TCommon =>
+ override def f = "in TOverrider" // The overridden self-type member...
+}
+
+class C2 extends C1 with TOverrider // ... fails to override, here.
+
+}
diff --git a/tests/pending/pos/self-type-override.scala b/tests/pending/pos/self-type-override.scala
deleted file mode 100644
index 7c40ef37e..000000000
--- a/tests/pending/pos/self-type-override.scala
+++ /dev/null
@@ -1,13 +0,0 @@
-trait TCommon {
- def f: String
-}
-
-class C1 extends TCommon {
- def f = "in C1"
-}
-
-trait TOverrider { this: TCommon =>
- override def f = "in TOverrider" // The overridden self-type member...
-}
-
-class C2 extends C1 with TOverrider // ... fails to override, here.
diff --git a/tests/pending/pos/t3278.scala b/tests/pending/pos/t3278.scala
deleted file mode 100644
index 458070c5e..000000000
--- a/tests/pending/pos/t3278.scala
+++ /dev/null
@@ -1,15 +0,0 @@
-class Foo
-class Test {
- def update[B](x : B, b : Int): Unit = {}
- def apply[B](x : B) = 1
-}
-
-object Test {
- def main(a : Array[String]): Unit = {
- 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
- }
-}
diff --git a/tests/pending/pos/t3480.scala b/tests/pending/pos/t3480.scala
index d9a092e8a..f04ea2933 100644
--- a/tests/pending/pos/t3480.scala
+++ b/tests/pending/pos/t3480.scala
@@ -1,4 +1,4 @@
object Test {
- val List(_*) = List(1)
+ val List(_: _*) = List(1)
val Array( who, what : _* ) = "Eclipse plugin cannot not handle this" split (" ")
}
diff --git a/tests/pending/pos/sammy_poly.scala b/tests/pos/sammy_poly.scala
index f43fa292c..f43fa292c 100644
--- a/tests/pending/pos/sammy_poly.scala
+++ b/tests/pos/sammy_poly.scala
diff --git a/tests/pending/pos/scoping1.scala b/tests/pos/scoping1.scala
index 9fe1b5f3e..83ad1357a 100644
--- a/tests/pending/pos/scoping1.scala
+++ b/tests/pos/scoping1.scala
@@ -2,7 +2,7 @@ object This extends App {
trait A {
def foo(): Unit
}
- class C { self: A =>
+ abstract class C { self: A =>
def bar() = this.foo()
}
class D extends C with A {
diff --git a/tests/pending/pos/sealed-final.scala b/tests/pos/sealed-final.scala
index bdedb5c1f..bdedb5c1f 100644
--- a/tests/pending/pos/sealed-final.scala
+++ b/tests/pos/sealed-final.scala
diff --git a/tests/pending/pos/spec-sealed.scala b/tests/pos/spec-sealed.scala
index d7ecfaaab..d7ecfaaab 100644
--- a/tests/pending/pos/spec-sealed.scala
+++ b/tests/pos/spec-sealed.scala
diff --git a/tests/pos/subtyping.scala b/tests/pos/subtyping.scala
index 29d830dd2..e65bdd16f 100644
--- a/tests/pos/subtyping.scala
+++ b/tests/pos/subtyping.scala
@@ -1,32 +1,5 @@
-class A {
- def test1(): Unit = {
- implicitly[this.type <:< this.type]
- implicitly[this.type <:< A]
- }
-}
object test {
- def tag1[T](x: T): String & T = ???
- def tag2[T](x: T): T & String = ???
-
- val x1: Int & String = tag1(0)
- val x2: Int & String = tag2(0)
- val x3: String & Int = tag1(0)
- val x4: String & Int = tag2(0)
-
-}
-
-object test2 {
-
- class A
- class B
-
- val x: A | B = ???
- val y: B | A = x
-
- val a: A & B = ???
- val b: B & A = a
+ val x: Int = 1
}
-
-
diff --git a/tests/pending/pos/t319.scala b/tests/pos/t319.scala
index eed25eb84..5c06f4db0 100644
--- a/tests/pending/pos/t319.scala
+++ b/tests/pos/t319.scala
@@ -14,7 +14,8 @@ object test {
val a = new A { type T = String };
/** val b: B { type T = String } = functor(a) */
val b: B { type T = String } = {
- val tmp = new functor() { val arg = a };
+ val tmp = new functor() { val arg: A { type T = String } = a };
+ // Dotty deviaton: arg needs an explicit type here, or else the inherited type `A` would be assumed.
tmp.res
}
diff --git a/tests/pos/t3278.scala b/tests/pos/t3278.scala
new file mode 100644
index 000000000..05bfbc146
--- /dev/null
+++ b/tests/pos/t3278.scala
@@ -0,0 +1,30 @@
+class Foo
+class Test {
+ def update[B](x : B, b : Int): Unit = {}
+ def apply[B](x : B) = 1
+}
+class Test2 {
+ type B = Foo
+ def update(x : B, b : Int): Unit = {}
+ def apply(x : B) = 1
+}
+
+object Test {
+ def main(a : Array[String]): Unit = {
+ 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
+ }
+}
+object Test2 {
+ def main(args : Array[String]): Unit = {
+ args(0) += "a"
+ val a = new Test2
+ val f = new Foo
+ a(f) = 1 //works
+ a(f) = a(f) + 1 //works
+ a(f) += 1 //error: reassignment to val
+ }
+}
diff --git a/tests/pending/pos/t3343.scala b/tests/pos/t3343.scala
index 9d1bc9355..9d1bc9355 100644
--- a/tests/pending/pos/t3343.scala
+++ b/tests/pos/t3343.scala
diff --git a/tests/pending/pos/t3411.scala b/tests/pos/t3411.scala
index 6d46be4e4..6d46be4e4 100644
--- a/tests/pending/pos/t3411.scala
+++ b/tests/pos/t3411.scala
diff --git a/tests/pending/pos/t344.scala b/tests/pos/t344.scala
index 449a763af..449a763af 100644
--- a/tests/pending/pos/t344.scala
+++ b/tests/pos/t344.scala