File tree 3 files changed +4
-4
lines changed
compiler/src/dotty/tools/dotc
3 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -769,7 +769,7 @@ class TypeComparer(@constructorOnly initctx: Context) extends ConstraintHandling
769
769
// `Mode.RelaxedOverriding` is only enabled when checking Java overriding
770
770
// in explicit nulls, and `Null` becomes a bottom type, which allows
771
771
// `T | Null` being a subtype of `T`.
772
- // A type varibale `T` from Java is translated to `T >: Nothing <: Any`.
772
+ // A type variable `T` from Java is translated to `T >: Nothing <: Any`.
773
773
// However, `null` can always be a value of `T` for Java side.
774
774
// So the best solution here is to let `Null` be bottom type temporarily.
775
775
def isNullable (tp : Type ): Boolean = ctx.mode.is(Mode .RelaxedOverriding ) || {
Original file line number Diff line number Diff line change @@ -217,7 +217,7 @@ object OverridingPairs:
217
217
)
218
218
else
219
219
// releaxed override check for explicit nulls if one of the symbols is Java defined,
220
- // force `Null` being a bottom types during override checking.
220
+ // force `Null` to be a bottom type during override checking.
221
221
val overrideCtx = if ctx.explicitNulls && (member.is(JavaDefined ) || other.is(JavaDefined ))
222
222
then ctx.retractMode(Mode .SafeNulls ).addMode(Mode .RelaxedOverriding ) else ctx
223
223
member.name.is(DefaultGetterName ) // default getters are not checked for compatibility
Original file line number Diff line number Diff line change @@ -112,8 +112,8 @@ object ResolveSuper {
112
112
val otherTp = other.asSeenFrom(base.typeRef).info
113
113
val accTp = acc.asSeenFrom(base.typeRef).info
114
114
// Since the super class can be Java defined,
115
- // we use releaxed overriding check for explicit nulls if one of the symbols is Java defined.
116
- // This forces `Null` being a bottom type during override checking.
115
+ // we use relaxed overriding check for explicit nulls if one of the symbols is Java defined.
116
+ // This forces `Null` to be a bottom type during override checking.
117
117
val overrideCtx = if ctx.explicitNulls && (sym.is(JavaDefined ) || acc.is(JavaDefined ))
118
118
then ctx.retractMode(Mode .SafeNulls ).addMode(Mode .RelaxedOverriding ) else ctx
119
119
if ! otherTp.overrides(accTp, matchLoosely = true )(using overrideCtx) then
You can’t perform that action at this time.
0 commit comments