Skip to content

Commit 5f8c59a

Browse files
committed
Change OrType and RefinedType nullification
1 parent 79a1a52 commit 5f8c59a

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

compiler/src/dotty/tools/dotc/core/ImplicitNullInterop.scala

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,9 +158,12 @@ object ImplicitNullInterop {
158158
// type of a final non-nullable field.
159159
case tp: ExprType => mapOver(tp)
160160
case tp: AnnotatedType => mapOver(tp)
161-
case tp: OrType => mapOver(tp)
162-
case tp: MatchType => mapOver(tp)
163-
case tp: RefinedType => nullify(mapOver(tp))
161+
case tp: OrType =>
162+
outermostLevelAlreadyNullable = true
163+
nullify(derivedOrType(tp, this(tp.tp1), this(tp.tp2)))
164+
case tp: RefinedType =>
165+
outermostLevelAlreadyNullable = true
166+
nullify(mapOver(tp))
164167
case _ => tp
165168
}
166169
}

0 commit comments

Comments
 (0)