Skip to content

Commit 6b6fd58

Browse files
committed
Update tests
1 parent 17eca24 commit 6b6fd58

29 files changed

+34
-434
lines changed

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -295,15 +295,17 @@ class CompilationTests extends ParallelTesting {
295295
implicit val testGroup: TestGroup = TestGroup("explicitNullsNeg")
296296
aggregateTests(
297297
compileFilesInDir("tests/explicit-nulls/neg", explicitNullsOptions),
298-
compileFilesInDir("tests/explicit-nulls/neg-patmat", explicitNullsOptions and "-Xfatal-warnings")
298+
compileFilesInDir("tests/explicit-nulls/neg-patmat", explicitNullsOptions and "-Xfatal-warnings"),
299+
compileFilesInDir("tests/explicit-nulls/unsafe-common", explicitNullsOptions),
299300
)
300301
}.checkExpectedErrors()
301302

302303
@Test def explicitNullsPos: Unit = {
303304
implicit val testGroup: TestGroup = TestGroup("explicitNullsPos")
304305
aggregateTests(
305306
compileFilesInDir("tests/explicit-nulls/pos", explicitNullsOptions),
306-
compileFilesInDir("tests/explicit-nulls/pos-separate", explicitNullsOptions)
307+
compileFilesInDir("tests/explicit-nulls/pos-separate", explicitNullsOptions),
308+
compileFilesInDir("tests/explicit-nulls/unsafe-common", explicitNullsOptions and "-language:unsafeNulls"),
307309
)
308310
}.checkCompile()
309311

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
class S {
2+
given Conversion[String, Array[String]] = _ => ???
3+
4+
def f = {
5+
val s: String | Null = ???
6+
7+
val x: String = s // error
8+
val xs: Array[String | Null] = s // error
9+
{
10+
import scala.language.unsafeNulls
11+
val y: String = s
12+
val ys: Array[String | Null] = s
13+
}
14+
15+
val z: String = s // error
16+
val zs: Array[String | Null] = s // error
17+
}
18+
}

tests/explicit-nulls/pos/unsafe-cast.scala

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

tests/explicit-nulls/pos/unsafe-chain.scala

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

tests/explicit-nulls/pos/unsafe-eq-null.scala

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

tests/explicit-nulls/pos/unsafe-extensions.scala

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

tests/explicit-nulls/pos/unsafe-implicit.scala

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

tests/explicit-nulls/pos/unsafe-java-chain/J.java

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

tests/explicit-nulls/pos/unsafe-java-chain/S.scala

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

tests/explicit-nulls/pos/unsafe-java-varargs-src/J.java

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

tests/explicit-nulls/pos/unsafe-java-varargs-src/S.scala

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

tests/explicit-nulls/pos/unsafe-java-varargs.scala

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

0 commit comments

Comments
 (0)