Skip to content

Commit 37dcada

Browse files
committed
Fix tests in Ycheck
1 parent 60d7781 commit 37dcada

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

-6
Original file line numberDiff line numberDiff line change
@@ -330,12 +330,6 @@ class SpaceEngine(using Context) extends SpaceLogic {
330330

331331
private val constantNullType = ConstantType(Constant(null))
332332

333-
/** Does the given tree stand for the literal `null`? */
334-
def isNullLit(tree: Tree): Boolean = tree match {
335-
case Literal(Constant(null)) => true
336-
case _ => false
337-
}
338-
339333
override def intersectUnrelatedAtomicTypes(tp1: Type, tp2: Type): Space = trace(s"atomic intersection: ${AndType(tp1, tp2).show}", debug) {
340334
// Precondition: !isSubType(tp1, tp2) && !isSubType(tp2, tp1).
341335
if !ctx.mode.is(Mode.SafeNulls) && (tp1.isNullType || tp2.isNullType) then

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -1601,7 +1601,7 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
16011601
result
16021602
}
16031603
}
1604-
if Nullables.unsafeNullsEnabled then
1604+
if Nullables.unsafeNullsEnabled && ctx.phase == Phases.typerPhase then
16051605
tree1.putAttachment(Nullables.UnsafeNullsMatch, ())
16061606
tree1
16071607

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

+1
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,7 @@ class CompilationTests {
247247
aggregateTests(
248248
compileFilesInDir("tests/explicit-nulls/pos", explicitNullsOptions),
249249
compileFilesInDir("tests/explicit-nulls/pos-separate", explicitNullsOptions),
250+
compileFilesInDir("tests/explicit-nulls/pos-patmat", explicitNullsOptions and "-Xfatal-warnings"),
250251
compileFilesInDir("tests/explicit-nulls/unsafe-common", explicitNullsOptions and "-language:unsafeNulls"),
251252
)
252253
}.checkCompile()

0 commit comments

Comments
 (0)