Skip to content

Commit 2866349

Browse files
committed
Fix tests in Ycheck
1 parent f83a846 commit 2866349

File tree

4 files changed

+2
-7
lines changed

4 files changed

+2
-7
lines changed

compiler/src/dotty/tools/dotc/transform/patmat/Space.scala

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -323,12 +323,6 @@ class SpaceEngine(using Context) extends SpaceLogic {
323323

324324
private val constantNullType = ConstantType(Constant(null))
325325

326-
/** Does the given tree stand for the literal `null`? */
327-
def isNullLit(tree: Tree): Boolean = tree match {
328-
case Literal(Constant(null)) => true
329-
case _ => false
330-
}
331-
332326
override def intersectUnrelatedAtomicTypes(tp1: Type, tp2: Type): Space = trace(s"atomic intersection: ${AndType(tp1, tp2).show}", debug) {
333327
// Precondition: !isSubType(tp1, tp2) && !isSubType(tp2, tp1).
334328
if !ctx.mode.is(Mode.SafeNulls) && (tp1.isNullType || tp2.isNullType) then

compiler/src/dotty/tools/dotc/typer/Typer.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1581,7 +1581,7 @@ class Typer extends Namer
15811581
result
15821582
}
15831583
}
1584-
if Nullables.unsafeNullsEnabled then
1584+
if Nullables.unsafeNullsEnabled && ctx.phase == Phases.typerPhase then
15851585
tree1.putAttachment(Nullables.UnsafeNullsMatch, ())
15861586
tree1
15871587

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,7 @@ class CompilationTests {
322322
aggregateTests(
323323
compileFilesInDir("tests/explicit-nulls/pos", explicitNullsOptions),
324324
compileFilesInDir("tests/explicit-nulls/pos-separate", explicitNullsOptions),
325+
compileFilesInDir("tests/explicit-nulls/pos-patmat", explicitNullsOptions and "-Xfatal-warnings"),
325326
compileFilesInDir("tests/explicit-nulls/unsafe-common", explicitNullsOptions and "-language:unsafeNulls"),
326327
)
327328
}.checkCompile()

0 commit comments

Comments
 (0)