Skip to content

Commit 4aa6b7a

Browse files
committed
Test reorg
1 parent 27cd90f commit 4aa6b7a

19 files changed

+59
-62
lines changed

test/dotc/tests.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ class tests extends CompilerTest {
8383
@Test def neg_autoTupling2 = compileFile(negDir, "autoTuplingTest", xerrors = 4)
8484
@Test def neg_companions = compileFile(negDir, "companions", xerrors = 1)
8585
@Test def neg_over = compileFile(negDir, "over", xerrors = 1)
86-
@Test def neg_overrides = compileFile(negDir, "overrides", xerrors = 7)
86+
@Test def neg_overrides = compileFile(negDir, "overrides", xerrors = 8)
8787
@Test def neg_projections = compileFile(negDir, "projections", xerrors = 1)
8888
@Test def neg_i39 = compileFile(negDir, "i39", xerrors = 1)
8989
@Test def neg_i50_volatile = compileFile(negDir, "i50-volatile", xerrors = 4)

tests/pending/pos/t3363-new.scala renamed to tests/disabled/structural-type/pos/t3363-new.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ object TestCase {
77

88
//if fs was reduced to List (generic type with one parameter) then the code compiles
99
//if you inherit from MapOps[T] instead of MapOps[F] then code compiles fine
10-
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] {
10+
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] {
1111
//if you remove this line, then code compiles
1212
lazy val m: TypeTag[T] = sys.error("just something to make it compile")
1313
def is(xs: List[T]) = List(xs)

tests/pending/pos/t3363-old.scala renamed to tests/disabled/structural-type/pos/t3363-old.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ object TestCase {
55

66
//if fs was reduced to List (generic type with one parameter) then the code compiles
77
//if you inherit from MapOps[T] instead of MapOps[F] then code compiles fine
8-
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] {
8+
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] {
99
//if you remove this line, then code compiles
1010
lazy val m: Manifest[T] = sys.error("just something to make it compile")
1111
def is(xs: List[T]) = List(xs)

tests/neg/overrides.scala

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,3 +79,24 @@ class Y2 extends X2 {
7979
class X3 {
8080
override type T = A1
8181
}
82+
83+
package p3 {
84+
85+
// Dotty change of rules: Toverrider#f does not
86+
// override TCommon#f, hence the accidental override rule
87+
// applies.
88+
trait TCommon {
89+
def f: String
90+
}
91+
92+
class C1 extends TCommon {
93+
def f = "in C1"
94+
}
95+
96+
trait TOverrider { this: TCommon =>
97+
override def f = "in TOverrider" // The overridden self-type member...
98+
}
99+
100+
class C2 extends C1 with TOverrider // ... fails to override, here.
101+
102+
}

tests/pending/pos/self-type-override.scala

Lines changed: 0 additions & 13 deletions
This file was deleted.

tests/pending/pos/t3278.scala

Lines changed: 0 additions & 15 deletions
This file was deleted.

tests/pending/pos/t3480.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
object Test {
2-
val List(_*) = List(1)
2+
val List(_: _*) = List(1)
33
val Array( who, what : _* ) = "Eclipse plugin cannot not handle this" split (" ")
44
}
File renamed without changes.

tests/pending/pos/scoping1.scala renamed to tests/pos/scoping1.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ object This extends App {
22
trait A {
33
def foo(): Unit
44
}
5-
class C { self: A =>
5+
abstract class C { self: A =>
66
def bar() = this.foo()
77
}
88
class D extends C with A {
File renamed without changes.
File renamed without changes.

tests/pos/subtyping.scala

Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,5 @@
1-
class A {
2-
def test1(): Unit = {
3-
implicitly[this.type <:< this.type]
4-
implicitly[this.type <:< A]
5-
}
6-
}
71
object test {
82

9-
def tag1[T](x: T): String & T = ???
10-
def tag2[T](x: T): T & String = ???
11-
12-
val x1: Int & String = tag1(0)
13-
val x2: Int & String = tag2(0)
14-
val x3: String & Int = tag1(0)
15-
val x4: String & Int = tag2(0)
16-
17-
}
18-
19-
object test2 {
20-
21-
class A
22-
class B
23-
24-
val x: A | B = ???
25-
val y: B | A = x
26-
27-
val a: A & B = ???
28-
val b: B & A = a
3+
val x: Int = 1
294

305
}
31-
32-

tests/pending/pos/t319.scala renamed to tests/pos/t319.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ object test {
1414
val a = new A { type T = String };
1515
/** val b: B { type T = String } = functor(a) */
1616
val b: B { type T = String } = {
17-
val tmp = new functor() { val arg = a };
17+
val tmp = new functor() { val arg: A { type T = String } = a };
18+
// Dotty deviaton: arg needs an explicit type here, or else the inherited type `A` would be assumed.
1819
tmp.res
1920
}
2021

tests/pos/t3278.scala

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
class Foo
2+
class Test {
3+
def update[B](x : B, b : Int): Unit = {}
4+
def apply[B](x : B) = 1
5+
}
6+
class Test2 {
7+
type B = Foo
8+
def update(x : B, b : Int): Unit = {}
9+
def apply(x : B) = 1
10+
}
11+
12+
object Test {
13+
def main(a : Array[String]): Unit = {
14+
val a = new Test
15+
val f = new Foo
16+
a(f) = 1 //works
17+
a(f) = a(f) + 1 //works
18+
a(f) += 1 //error: reassignment to val
19+
}
20+
}
21+
object Test2 {
22+
def main(args : Array[String]): Unit = {
23+
args(0) += "a"
24+
val a = new Test2
25+
val f = new Foo
26+
a(f) = 1 //works
27+
a(f) = a(f) + 1 //works
28+
a(f) += 1 //error: reassignment to val
29+
}
30+
}
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)