Skip to content

Commit

Permalink
Fix tests in Ycheck
Browse files Browse the repository at this point in the history
  • Loading branch information
noti0na1 committed Nov 19, 2021
1 parent f83a846 commit 2866349
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 7 deletions.
6 changes: 0 additions & 6 deletions compiler/src/dotty/tools/dotc/transform/patmat/Space.scala
Expand Up @@ -323,12 +323,6 @@ class SpaceEngine(using Context) extends SpaceLogic {

private val constantNullType = ConstantType(Constant(null))

/** Does the given tree stand for the literal `null`? */
def isNullLit(tree: Tree): Boolean = tree match {
case Literal(Constant(null)) => true
case _ => false
}

override def intersectUnrelatedAtomicTypes(tp1: Type, tp2: Type): Space = trace(s"atomic intersection: ${AndType(tp1, tp2).show}", debug) {
// Precondition: !isSubType(tp1, tp2) && !isSubType(tp2, tp1).
if !ctx.mode.is(Mode.SafeNulls) && (tp1.isNullType || tp2.isNullType) then
Expand Down
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/typer/Typer.scala
Expand Up @@ -1581,7 +1581,7 @@ class Typer extends Namer
result
}
}
if Nullables.unsafeNullsEnabled then
if Nullables.unsafeNullsEnabled && ctx.phase == Phases.typerPhase then
tree1.putAttachment(Nullables.UnsafeNullsMatch, ())
tree1

Expand Down
1 change: 1 addition & 0 deletions compiler/test/dotty/tools/dotc/CompilationTests.scala
Expand Up @@ -322,6 +322,7 @@ class CompilationTests {
aggregateTests(
compileFilesInDir("tests/explicit-nulls/pos", explicitNullsOptions),
compileFilesInDir("tests/explicit-nulls/pos-separate", explicitNullsOptions),
compileFilesInDir("tests/explicit-nulls/pos-patmat", explicitNullsOptions and "-Xfatal-warnings"),
compileFilesInDir("tests/explicit-nulls/unsafe-common", explicitNullsOptions and "-language:unsafeNulls"),
)
}.checkCompile()
Expand Down

0 comments on commit 2866349

Please sign in to comment.