File tree 2 files changed +2
-2
lines changed
compiler/src/dotty/tools/dotc/core
2 files changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -970,7 +970,6 @@ class TypeComparer(@constructorOnly initctx: Context) extends ConstraintHandling
970
970
def isNullable (tp : Type ): Boolean = tp.dealias match
971
971
case tp : TypeRef =>
972
972
val tpSym = tp.symbol
973
- ! tpSym.isPrimitiveValueClass ||
974
973
tpSym.isNullableClass
975
974
case tp : TermRef =>
976
975
// https://scala-lang.org/files/archive/spec/2.13/03-types.html#singleton-types
Original file line number Diff line number Diff line change @@ -1193,7 +1193,8 @@ object Types extends TypeUtils {
1193
1193
*/
1194
1194
def matches (that : Type )(using Context ): Boolean = {
1195
1195
record(" matches" )
1196
- TypeComparer .matchesType(this , that, relaxed = ! ctx.phase.erasedTypes)
1196
+ withoutMode(Mode .SafeNulls )(
1197
+ TypeComparer .matchesType(this , that, relaxed = ! ctx.phase.erasedTypes))
1197
1198
}
1198
1199
1199
1200
/** This is the same as `matches` except that it also matches => T with T and
You can’t perform that action at this time.
0 commit comments