Skip to content

Commit

Permalink
Fix typos
Browse files Browse the repository at this point in the history
  • Loading branch information
noti0na1 committed Feb 10, 2022
1 parent 247c6da commit 6bb73a5
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/core/TypeComparer.scala
Original file line number Diff line number Diff line change
Expand Up @@ -769,7 +769,7 @@ class TypeComparer(@constructorOnly initctx: Context) extends ConstraintHandling
// `Mode.RelaxedOverriding` is only enabled when checking Java overriding
// in explicit nulls, and `Null` becomes a bottom type, which allows
// `T | Null` being a subtype of `T`.
// A type varibale `T` from Java is translated to `T >: Nothing <: Any`.
// A type variable `T` from Java is translated to `T >: Nothing <: Any`.
// However, `null` can always be a value of `T` for Java side.
// So the best solution here is to let `Null` be bottom type temporarily.
def isNullable(tp: Type): Boolean = ctx.mode.is(Mode.RelaxedOverriding) || {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ object OverridingPairs:
)
else
// releaxed override check for explicit nulls if one of the symbols is Java defined,
// force `Null` being a bottom types during override checking.
// force `Null` to be a bottom type during override checking.
val overrideCtx = if ctx.explicitNulls && (member.is(JavaDefined) || other.is(JavaDefined))
then ctx.retractMode(Mode.SafeNulls).addMode(Mode.RelaxedOverriding) else ctx
member.name.is(DefaultGetterName) // default getters are not checked for compatibility
Expand Down
4 changes: 2 additions & 2 deletions compiler/src/dotty/tools/dotc/transform/ResolveSuper.scala
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@ object ResolveSuper {
val otherTp = other.asSeenFrom(base.typeRef).info
val accTp = acc.asSeenFrom(base.typeRef).info
// Since the super class can be Java defined,
// we use releaxed overriding check for explicit nulls if one of the symbols is Java defined.
// This forces `Null` being a bottom type during override checking.
// we use relaxed overriding check for explicit nulls if one of the symbols is Java defined.
// This forces `Null` to be a bottom type during override checking.
val overrideCtx = if ctx.explicitNulls && (sym.is(JavaDefined) || acc.is(JavaDefined))
then ctx.retractMode(Mode.SafeNulls).addMode(Mode.RelaxedOverriding) else ctx
if !otherTp.overrides(accTp, matchLoosely = true)(using overrideCtx) then
Expand Down

0 comments on commit 6bb73a5

Please sign in to comment.