diff options
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker')
10 files changed, 17 insertions, 17 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/AnalyzerPlugins.scala b/src/compiler/scala/tools/nsc/typechecker/AnalyzerPlugins.scala index 9898cfd785..e9cce95096 100644 --- a/src/compiler/scala/tools/nsc/typechecker/AnalyzerPlugins.scala +++ b/src/compiler/scala/tools/nsc/typechecker/AnalyzerPlugins.scala @@ -38,7 +38,7 @@ trait AnalyzerPlugins { self: Analyzer => * Let analyzer plugins modify the type that has been computed for a tree. * * @param tpe The type inferred by the type checker, initially (for first plugin) `tree.tpe` - * @param typer The yper that type checked `tree` + * @param typer The typer that type checked `tree` * @param tree The type-checked tree * @param mode Mode that was used for typing `tree` * @param pt Expected type that was used for typing `tree` diff --git a/src/compiler/scala/tools/nsc/typechecker/ContextErrors.scala b/src/compiler/scala/tools/nsc/typechecker/ContextErrors.scala index 0910dca445..3bbc9f3a62 100644 --- a/src/compiler/scala/tools/nsc/typechecker/ContextErrors.scala +++ b/src/compiler/scala/tools/nsc/typechecker/ContextErrors.scala @@ -376,7 +376,7 @@ trait ContextErrors { } issueNormalTypeError(sel, errMsg) // the error has to be set for the copied tree, otherwise - // the error remains persistent acros multiple compilations + // the error remains persistent across multiple compilations // and causes problems //setError(sel) } diff --git a/src/compiler/scala/tools/nsc/typechecker/Contexts.scala b/src/compiler/scala/tools/nsc/typechecker/Contexts.scala index 7a3b8d2ab6..db3bb9badb 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Contexts.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Contexts.scala @@ -439,7 +439,7 @@ trait Contexts { self: Analyzer => * Construct a child context. The parent and child will share the report buffer. * Compare with `makeSilent`, in which the child has a fresh report buffer. * - * If `tree` is an `Import`, that import will be avaiable at the head of + * If `tree` is an `Import`, that import will be available at the head of * `Context#imports`. */ def make(tree: Tree = tree, owner: Symbol = owner, diff --git a/src/compiler/scala/tools/nsc/typechecker/Implicits.scala b/src/compiler/scala/tools/nsc/typechecker/Implicits.scala index 33e176a309..66ed0902d8 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Implicits.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Implicits.scala @@ -161,7 +161,7 @@ trait Implicits { } /* Map a polytype to one in which all type parameters and argument-dependent types are replaced by wildcards. - * Consider `implicit def b(implicit x: A): x.T = error("")`. We need to approximate debruijn index types + * Consider `implicit def b(implicit x: A): x.T = error("")`. We need to approximate de Bruijn index types * when checking whether `b` is a valid implicit, as we haven't even searched a value for the implicit arg `x`, * so we have to approximate (otherwise it is excluded a priori). */ @@ -358,8 +358,8 @@ trait Implicits { val undetParams = if (isView) Nil else context.outer.undetparams val wildPt = approximate(pt) - private val runDefintions = currentRun.runDefinitions - import runDefintions._ + private val stableRunDefsForImport = currentRun.runDefinitions + import stableRunDefsForImport._ def undet_s = if (undetParams.isEmpty) "" else undetParams.mkString(" inferring ", ", ", "") def tree_s = typeDebug ptTree tree diff --git a/src/compiler/scala/tools/nsc/typechecker/Macros.scala b/src/compiler/scala/tools/nsc/typechecker/Macros.scala index d7c53ed3c4..6de95ab658 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Macros.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Macros.scala @@ -697,7 +697,7 @@ trait Macros extends MacroRuntimes with Traces with Helpers { // foo(Foo(23, "foo", true)) // // In the snippet above, even though we know that there's a fundep going from T to U - // (in a sense that a datatype's uniform representation is unambiguously determined by the datatype, + // (in a sense that a datatype's uniform representation is unambiguously determined by the data type, // e.g. for Foo it will be Int :: String :: Boolean :: HNil), there's no way to convey this information // to the typechecker. Therefore the typechecker will infer Nothing for L, which is hardly what we want. // diff --git a/src/compiler/scala/tools/nsc/typechecker/Namers.scala b/src/compiler/scala/tools/nsc/typechecker/Namers.scala index 28169c9da1..095cc555e9 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Namers.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Namers.scala @@ -1348,7 +1348,7 @@ trait Namers extends MethodSynthesis { // Add a () parameter section if this overrides some method with () parameters val vparamSymssOrEmptyParamsFromOverride = - if (overridden != NoSymbol && vparamSymss.isEmpty && overridden.alternatives.exists(_.info.isInstanceOf[MethodType])) ListOfNil // NOTEL must check `.info.isInstanceOf[MethodType]`, not `.isMethod`! + if (overridden != NoSymbol && vparamSymss.isEmpty && overridden.alternatives.exists(_.info.isInstanceOf[MethodType])) ListOfNil // NOTE: must check `.info.isInstanceOf[MethodType]`, not `.isMethod`! else vparamSymss val methSig = deskolemizedPolySig(vparamSymssOrEmptyParamsFromOverride, resTp) diff --git a/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala b/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala index 31476e86cd..7b261810d4 100644 --- a/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala +++ b/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala @@ -1661,7 +1661,7 @@ abstract class RefChecks extends Transform { case tp @ ExistentialType(tparams, tpe) => existentialParams ++= tparams case ann: AnnotatedType if ann.hasAnnotation(UncheckedBoundsClass) => - // SI-7694 Allow code synthetizers to disable checking of bounds for TypeTrees based on inferred LUBs + // SI-7694 Allow code synthesizers to disable checking of bounds for TypeTrees based on inferred LUBs // which might not conform to the constraints. skipBounds = true case tp: TypeRef => diff --git a/src/compiler/scala/tools/nsc/typechecker/SuperAccessors.scala b/src/compiler/scala/tools/nsc/typechecker/SuperAccessors.scala index 8b1b2f35c5..57906cfe0a 100644 --- a/src/compiler/scala/tools/nsc/typechecker/SuperAccessors.scala +++ b/src/compiler/scala/tools/nsc/typechecker/SuperAccessors.scala @@ -315,7 +315,7 @@ abstract class SuperAccessors extends transform.Transform with transform.TypingT * A trait which extends a class and accesses a protected member * of that class cannot implement the necessary accessor method * because jvm access restrictions require the call site to be - * in an actual subclass, and an interface cannot extenda class. + * in an actual subclass, and an interface cannot extend a class. * So, non-trait classes inspect their ancestors for any such situations * and generate the accessors. See SI-2296. * diff --git a/src/compiler/scala/tools/nsc/typechecker/TypeDiagnostics.scala b/src/compiler/scala/tools/nsc/typechecker/TypeDiagnostics.scala index 36b9a65334..35e6e0099e 100644 --- a/src/compiler/scala/tools/nsc/typechecker/TypeDiagnostics.scala +++ b/src/compiler/scala/tools/nsc/typechecker/TypeDiagnostics.scala @@ -117,13 +117,13 @@ trait TypeDiagnostics { */ final def exampleTuplePattern(names: List[Name]): String = { val arity = names.length - val varPatterNames: Option[List[String]] = sequence(names map { + val varPatternNames: Option[List[String]] = sequence(names map { case name if nme.isVariableName(name) => Some(name.decode) case _ => None }) def parenthesize(a: String) = s"($a)" def genericParams = (Seq("param1") ++ (if (arity > 2) Seq("...") else Nil) ++ Seq(s"param$arity")) - parenthesize(varPatterNames.getOrElse(genericParams).mkString(", ")) + parenthesize(varPatternNames.getOrElse(genericParams).mkString(", ")) } def alternatives(tree: Tree): List[Type] = tree.tpe match { diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala index 2cbd9475fc..85ca9950c4 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala @@ -904,7 +904,7 @@ trait Typers extends Adaptations with Tags with TypersTracking with PatternTyper if (meth.isConstructor) cantAdapt // (4.2) eta-expand method value when function or sam type is expected else if (isFunctionType(pt) || (!mt.params.isEmpty && samOf(pt).exists)) { - // SI-9536 `!mt.params.isEmpty &&`: for backwards compatiblity with 2.11, + // SI-9536 `!mt.params.isEmpty &&`: for backwards compatibility with 2.11, // we don't adapt a zero-arg method value to a SAM // In 2.13, we won't do any eta-expansion for zero-arg method values, but we should deprecate first @@ -2404,7 +2404,7 @@ trait Typers extends Adaptations with Tags with TypersTracking with PatternTyper for (stat <- block.stats) enterLabelDef(stat) if (phaseId(currentPeriod) <= currentRun.typerPhase.id) { - // This is very tricky stuff, because we are navigating the Skylla and Charybdis of + // This is very tricky stuff, because we are navigating the Scylla and Charybdis of // anonymous classes and what to return from them here. On the one hand, we cannot admit // every non-private member of an anonymous class as a part of the structural type of the // enclosing block. This runs afoul of the restriction that a structural type may not @@ -2978,7 +2978,7 @@ trait Typers extends Adaptations with Tags with TypersTracking with PatternTyper val funPt = normalize(methTyped.tpe) baseType FunctionClass(numVparams) // println(s"typeUnEtaExpanded $meth : ${methTyped.tpe} --> normalized: $funPt") - // If we are sure this function type provides all the necesarry info, so that we won't have + // If we are sure this function type provides all the necessary info, so that we won't have // any undetermined argument types, go ahead an recurse below (`typedFunction(fun, mode, ptUnrollingEtaExpansion)`) // and rest assured we won't end up right back here (and keep recursing) if (isFunctionType(funPt) && funPt.typeArgs.iterator.take(numVparams).forall(isFullyDefined)) funPt @@ -3091,7 +3091,7 @@ trait Typers extends Adaptations with Tags with TypersTracking with PatternTyper result } - // TODO: adapt to new trait field encoding, figure out why this exaemption is made + // TODO: adapt to new trait field encoding, figure out why this exemption is made // 'accessor' and 'accessed' are so similar it becomes very difficult to //follow the logic, so I renamed one to something distinct. def accesses(looker: Symbol, accessed: Symbol) = accessed.isLocalToThis && ( @@ -4842,7 +4842,7 @@ trait Typers extends Adaptations with Tags with TypersTracking with PatternTyper if (!(context.unit.isJava && cls.isClass && !cls.isModuleClass)) NoSymbol else { val companion = companionSymbolOf(cls, context) if (!companion.exists) NoSymbol - else member(gen.mkAttributedRef(pre, companion), name) // assert(res.isStatic, s"inCompanionJavaStatic($pre, $cls, $name) = $res ${res.debugFlagString}") + else member(gen.mkAttributedRef(pre, companion), name) // assert(res.isStatic, s"inCompanionForJavaStatic($pre, $cls, $name) = $res ${res.debugFlagString}") } /* Attribute a selection where `tree` is `qual.name`. |