Skip to content

Commit 1a9b409

Browse files
committed
Migrate hybrid tests
1 parent 60cbb7d commit 1a9b409

File tree

10 files changed

+65
-65
lines changed

10 files changed

+65
-65
lines changed

compiler/src/dotty/tools/dotc/transform/init/Checking.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ object Checking {
206206

207207
case Warm(cls, outer) =>
208208
theCtx.warning(
209-
"Leaking of warm value " + eff.source.show +
209+
"Leaking of value under initialization: " + pot.source.show +
210210
". Calling trace:\n" + state.trace,
211211
eff.source.sourcePos
212212
)

compiler/test/dotty/tools/dotc/CompilationTests.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,6 @@ class CompilationTests extends ParallelTesting {
302302
aggregateTests(
303303
compileFilesInDir("tests/init/neg/", options),
304304
compileFilesInDir("tests/init/neg/misc", options),
305-
compileFilesInDir("tests/init/neg/hybrid", options),
306305
compileFilesInDir("tests/init/neg/crash", options),
307306
)
308307
}.checkExpectedErrors()

tests/init/neg/hybrid/hybrid2.scala

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

tests/init/neg/hybrid/hybrid5.scala

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

tests/init/neg/hybrid/hybrid6.scala

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

tests/init/neg/hybrid/hybrid1.scala renamed to tests/init/neg/hybrid1.scala

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@ trait A {
22
def g: Int
33
}
44

5-
class X(_y: Y) {
6-
class B extends A {
7-
def g = _y.n
5+
class Y {
6+
class X {
7+
class B extends A {
8+
def g = n
9+
}
810
}
9-
}
1011

11-
class Y {
12-
val x = new X(this)
12+
val x = new X
1313

1414
class C extends x.B {
1515
g

tests/init/neg/hybrid2.scala

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
trait A {
2+
def g: Int
3+
}
4+
5+
class Y {
6+
7+
class X {
8+
class B extends A {
9+
def g = n
10+
}
11+
12+
val b = new B
13+
}
14+
15+
val x = new X
16+
x.b.g // error
17+
18+
val n = 10
19+
}

tests/init/neg/hybrid/hybrid4.scala renamed to tests/init/neg/hybrid4.scala

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ class Foo {
33
val len = list.size
44
}
55

6-
val bar: Bar = new Bar(this)
6+
class Bar {
7+
val inner = new Inner
8+
}
9+
10+
val bar: Bar = new Bar
711
val list = List(1, 2, 3) // error
812
}
9-
10-
class Bar(val _foo: Foo) {
11-
val inner = new _foo.Inner
12-
}

tests/init/neg/hybrid5.scala

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
class Foo {
2+
val bar = new Bar
3+
var x: bar.Inner = new bar.Inner
4+
5+
class Inner {
6+
val len = list.size
7+
}
8+
9+
class Bar {
10+
class Inner {
11+
val x = g
12+
val len: Int = x.len
13+
}
14+
15+
def g = new Foo.this.Inner
16+
}
17+
18+
val list = List(1, 2, 3) // error
19+
}

tests/init/neg/hybrid6.scala

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
class Foo {
2+
val bar = new Bar
3+
var x: bar.Inner = new bar.Inner
4+
5+
class Bar {
6+
class Inner {
7+
val x = g
8+
val len = x.size
9+
}
10+
11+
def g = list
12+
}
13+
14+
val list = List(1, 2, 3) // error
15+
}

0 commit comments

Comments
 (0)