From 6bb73a522815ae940281c866d70030ce8c33c668 Mon Sep 17 00:00:00 2001 From: noti0na1 Date: Thu, 10 Feb 2022 12:15:51 -0500 Subject: [PATCH] Fix typos --- compiler/src/dotty/tools/dotc/core/TypeComparer.scala | 2 +- compiler/src/dotty/tools/dotc/transform/OverridingPairs.scala | 2 +- compiler/src/dotty/tools/dotc/transform/ResolveSuper.scala | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/compiler/src/dotty/tools/dotc/core/TypeComparer.scala b/compiler/src/dotty/tools/dotc/core/TypeComparer.scala index c5c25cafc085..18d469f8e2f8 100644 --- a/compiler/src/dotty/tools/dotc/core/TypeComparer.scala +++ b/compiler/src/dotty/tools/dotc/core/TypeComparer.scala @@ -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) || { diff --git a/compiler/src/dotty/tools/dotc/transform/OverridingPairs.scala b/compiler/src/dotty/tools/dotc/transform/OverridingPairs.scala index f67f11cbf920..a40ef61ddebd 100644 --- a/compiler/src/dotty/tools/dotc/transform/OverridingPairs.scala +++ b/compiler/src/dotty/tools/dotc/transform/OverridingPairs.scala @@ -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 diff --git a/compiler/src/dotty/tools/dotc/transform/ResolveSuper.scala b/compiler/src/dotty/tools/dotc/transform/ResolveSuper.scala index 1f5aa25535d7..1ee7ee09d843 100644 --- a/compiler/src/dotty/tools/dotc/transform/ResolveSuper.scala +++ b/compiler/src/dotty/tools/dotc/transform/ResolveSuper.scala @@ -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