From a4c68e9bf7aa15483913900dd1bb3fd02dcc7363 Mon Sep 17 00:00:00 2001 From: Michał Pociecha Date: Fri, 10 Apr 2015 15:30:28 +0200 Subject: Fix many typos This commit corrects many typos found in scaladocs and comments. There's also fixed the name of a private method in ICodeCheckers. --- src/compiler/scala/reflect/quasiquotes/Reifiers.scala | 2 +- src/compiler/scala/tools/nsc/PhaseAssembly.scala | 2 +- src/compiler/scala/tools/nsc/ast/parser/Parsers.scala | 2 +- src/compiler/scala/tools/nsc/backend/icode/ICodeCheckers.scala | 8 ++++---- .../scala/tools/nsc/backend/icode/analysis/TypeFlowAnalysis.scala | 2 +- src/compiler/scala/tools/nsc/backend/jvm/BTypes.scala | 2 +- .../scala/tools/nsc/backend/opt/DeadCodeElimination.scala | 4 ++-- src/compiler/scala/tools/nsc/transform/Constructors.scala | 2 +- src/compiler/scala/tools/nsc/transform/Delambdafy.scala | 4 ++-- src/compiler/scala/tools/nsc/transform/LazyVals.scala | 2 +- src/compiler/scala/tools/nsc/transform/Mixin.scala | 4 ++-- src/compiler/scala/tools/nsc/transform/SampleTransform.scala | 2 +- src/compiler/scala/tools/nsc/transform/SpecializeTypes.scala | 4 ++-- src/compiler/scala/tools/nsc/typechecker/AnalyzerPlugins.scala | 2 +- src/compiler/scala/tools/nsc/typechecker/Contexts.scala | 8 ++++---- src/compiler/scala/tools/nsc/typechecker/Infer.scala | 2 +- src/compiler/scala/tools/nsc/typechecker/Namers.scala | 2 +- src/compiler/scala/tools/nsc/typechecker/RefChecks.scala | 2 +- src/compiler/scala/tools/nsc/typechecker/Typers.scala | 2 +- 19 files changed, 29 insertions(+), 29 deletions(-) (limited to 'src/compiler') diff --git a/src/compiler/scala/reflect/quasiquotes/Reifiers.scala b/src/compiler/scala/reflect/quasiquotes/Reifiers.scala index 7c0e7dfbb8..e753c9787a 100644 --- a/src/compiler/scala/reflect/quasiquotes/Reifiers.scala +++ b/src/compiler/scala/reflect/quasiquotes/Reifiers.scala @@ -317,7 +317,7 @@ trait Reifiers { self: Quasiquotes => * Reification of non-trivial list is done in two steps: * * 1. split the list into groups where every placeholder is always - * put in a group of it's own and all subsquent non-holeMap are + * put in a group of its own and all subsquent non-holeMap are * grouped together; element is considered to be a placeholder if it's * in the domain of the fill function; * diff --git a/src/compiler/scala/tools/nsc/PhaseAssembly.scala b/src/compiler/scala/tools/nsc/PhaseAssembly.scala index e1cfa63960..4b32aab5ee 100644 --- a/src/compiler/scala/tools/nsc/PhaseAssembly.scala +++ b/src/compiler/scala/tools/nsc/PhaseAssembly.scala @@ -127,7 +127,7 @@ trait PhaseAssembly { } /* Find all edges in the given graph that are hard links. For each hard link we - * need to check that its the only dependency. If not, then we will promote the + * need to check that it's the only dependency. If not, then we will promote the * other dependencies down */ def validateAndEnforceHardlinks() { diff --git a/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala b/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala index 67e91ae857..4f195c2985 100644 --- a/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala +++ b/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala @@ -1259,7 +1259,7 @@ self => atPos(start) { Apply(t3, exprsBuf.toList) } } if (inPattern) stringCheese - else withPlaceholders(stringCheese, isAny = true) // strinterpolator params are Any* by definition + else withPlaceholders(stringCheese, isAny = true) // string interpolator params are Any* by definition } /* ------------- NEW LINES ------------------------------------------------- */ diff --git a/src/compiler/scala/tools/nsc/backend/icode/ICodeCheckers.scala b/src/compiler/scala/tools/nsc/backend/icode/ICodeCheckers.scala index 0cdf629ce1..843648282b 100644 --- a/src/compiler/scala/tools/nsc/backend/icode/ICodeCheckers.scala +++ b/src/compiler/scala/tools/nsc/backend/icode/ICodeCheckers.scala @@ -109,7 +109,7 @@ abstract class ICodeCheckers { /** Only called when m1 < m2, so already known that (m1 ne m2). */ - private def isConfict(m1: IMember, m2: IMember, canOverload: Boolean) = ( + private def isConflict(m1: IMember, m2: IMember, canOverload: Boolean) = ( (m1.symbol.name == m2.symbol.name) && (!canOverload || (m1.symbol.tpe =:= m2.symbol.tpe)) ) @@ -119,11 +119,11 @@ abstract class ICodeCheckers { clasz = cls for (f1 <- cls.fields ; f2 <- cls.fields ; if f1 < f2) - if (isConfict(f1, f2, canOverload = false)) + if (isConflict(f1, f2, canOverload = false)) icodeError("Repetitive field name: " + f1.symbol.fullName) for (m1 <- cls.methods ; m2 <- cls.methods ; if m1 < m2) - if (isConfict(m1, m2, canOverload = true)) + if (isConflict(m1, m2, canOverload = true)) icodeError("Repetitive method: " + m1.symbol.fullName) clasz.methods foreach check @@ -471,7 +471,7 @@ abstract class ICodeCheckers { pushStack(local.kind) case LOAD_FIELD(field, isStatic) => - // the symbol's owner should contain it's field, but + // the symbol's owner should contain its field, but // this is already checked by the type checker, no need // to redo that here if (isStatic) () diff --git a/src/compiler/scala/tools/nsc/backend/icode/analysis/TypeFlowAnalysis.scala b/src/compiler/scala/tools/nsc/backend/icode/analysis/TypeFlowAnalysis.scala index b0ad5bdaf9..058b6a161d 100644 --- a/src/compiler/scala/tools/nsc/backend/icode/analysis/TypeFlowAnalysis.scala +++ b/src/compiler/scala/tools/nsc/backend/icode/analysis/TypeFlowAnalysis.scala @@ -572,7 +572,7 @@ abstract class TypeFlowAnalysis { - `inlined` : These blocks were spliced into the method's CFG as part of inlining. Being new blocks, they haven't been visited yet by the typeflow analysis. - - `staleIn` : These blocks are what `doInline()` calls `afterBlock`s, ie the new home for instructions that previously appearead + - `staleIn` : These blocks are what `doInline()` calls `afterBlock`s, ie the new home for instructions that previously appeared after a callsite in a `staleOut` block. Based on the above information, we have to bring up-to-date the caches that `forwardAnalysis` and `blockTransfer` use to skip blocks and instructions. diff --git a/src/compiler/scala/tools/nsc/backend/jvm/BTypes.scala b/src/compiler/scala/tools/nsc/backend/jvm/BTypes.scala index d690542f0e..e61190bf3a 100644 --- a/src/compiler/scala/tools/nsc/backend/jvm/BTypes.scala +++ b/src/compiler/scala/tools/nsc/backend/jvm/BTypes.scala @@ -315,7 +315,7 @@ abstract class BTypes { case ArrayBType(component) => if (other == ObjectReference || other == jlCloneableReference || other == jioSerializableReference) true else other match { - case ArrayBType(otherComponoent) => component.conformsTo(otherComponoent).orThrow + case ArrayBType(otherComponent) => component.conformsTo(otherComponent).orThrow case _ => false } diff --git a/src/compiler/scala/tools/nsc/backend/opt/DeadCodeElimination.scala b/src/compiler/scala/tools/nsc/backend/opt/DeadCodeElimination.scala index 3704acb055..1b6631e7a4 100644 --- a/src/compiler/scala/tools/nsc/backend/opt/DeadCodeElimination.scala +++ b/src/compiler/scala/tools/nsc/backend/opt/DeadCodeElimination.scala @@ -173,7 +173,7 @@ abstract class DeadCodeElimination extends SubComponent { moveToWorkList() case LOAD_FIELD(sym, isStatic) if isStatic || !inliner.isClosureClass(sym.owner) => - // static load may trigger static initization. + // static load may trigger static initialization. // non-static load can throw NPE (but we know closure fields can't be accessed via a // null reference. moveToWorkList() @@ -191,7 +191,7 @@ abstract class DeadCodeElimination extends SubComponent { case LOAD_EXCEPTION(_) | DUP(_) | LOAD_MODULE(_) => true case _ => dropOf((bb1, idx1)) = (bb,idx) :: dropOf.getOrElse((bb1, idx1), Nil) - debuglog("DROP is innessential: " + i + " because of: " + bb1(idx1) + " at " + bb1 + ":" + idx1) + debuglog("DROP is inessential: " + i + " because of: " + bb1(idx1) + " at " + bb1 + ":" + idx1) false } } diff --git a/src/compiler/scala/tools/nsc/transform/Constructors.scala b/src/compiler/scala/tools/nsc/transform/Constructors.scala index d0fca12e6a..86685d46de 100644 --- a/src/compiler/scala/tools/nsc/transform/Constructors.scala +++ b/src/compiler/scala/tools/nsc/transform/Constructors.scala @@ -315,7 +315,7 @@ abstract class Constructors extends Statics with Transform with ast.TreeDSL { } def rewriteDelayedInit() { - /* XXX This is not corect: remainingConstrStats.nonEmpty excludes too much, + /* XXX This is not correct: remainingConstrStats.nonEmpty excludes too much, * but excluding it includes too much. The constructor sequence being mimicked * needs to be reproduced with total fidelity. * diff --git a/src/compiler/scala/tools/nsc/transform/Delambdafy.scala b/src/compiler/scala/tools/nsc/transform/Delambdafy.scala index 2d33b35241..45a89ac594 100644 --- a/src/compiler/scala/tools/nsc/transform/Delambdafy.scala +++ b/src/compiler/scala/tools/nsc/transform/Delambdafy.scala @@ -77,7 +77,7 @@ abstract class Delambdafy extends Transform with TypingTransformers with ast.Tre // the result of the transformFunction method. sealed abstract class TransformedFunction - // A class definition for the lambda, an expression insantiating the lambda class + // A class definition for the lambda, an expression instantiating the lambda class case class DelambdafyAnonClass(lambdaClassDef: ClassDef, newExpr: Tree) extends TransformedFunction // here's the main entry point of the transform @@ -86,7 +86,7 @@ abstract class Delambdafy extends Transform with TypingTransformers with ast.Tre case fun @ Function(_, _) => transformFunction(fun) match { case DelambdafyAnonClass(lambdaClassDef, newExpr) => - // a lambda beccomes a new class, an instantiation expression + // a lambda becomes a new class, an instantiation expression val pkg = lambdaClassDef.symbol.owner // we'll add the lambda class to the package later diff --git a/src/compiler/scala/tools/nsc/transform/LazyVals.scala b/src/compiler/scala/tools/nsc/transform/LazyVals.scala index 38671ebaae..df622d4d1d 100644 --- a/src/compiler/scala/tools/nsc/transform/LazyVals.scala +++ b/src/compiler/scala/tools/nsc/transform/LazyVals.scala @@ -219,7 +219,7 @@ abstract class LazyVals extends Transform with TypingTransformers with ast.TreeD * l$ * } or * when the lazy value has type Unit (for which there is no field - * to cache it's value. + * to cache its value. * * Similarly as for normal lazy val members (see Mixin), the result will be a tree of the form * { if ((bitmap&n & MASK) == 0) this.l$compute() diff --git a/src/compiler/scala/tools/nsc/transform/Mixin.scala b/src/compiler/scala/tools/nsc/transform/Mixin.scala index 408f4466e1..11f9483f77 100644 --- a/src/compiler/scala/tools/nsc/transform/Mixin.scala +++ b/src/compiler/scala/tools/nsc/transform/Mixin.scala @@ -26,7 +26,7 @@ abstract class Mixin extends InfoTransform with ast.TreeDSL { */ private val treatedClassInfos = perRunCaches.newMap[Symbol, Type]() withDefaultValue NoType - /** Map a lazy, mixedin field accessor to it's trait member accessor */ + /** Map a lazy, mixedin field accessor to its trait member accessor */ private val initializer = perRunCaches.newMap[Symbol, Symbol]() // --------- helper functions ----------------------------------------------- @@ -886,7 +886,7 @@ abstract class Mixin extends InfoTransform with ast.TreeDSL { } /* Complete lazy field accessors. Applies only to classes, - * for it's own (non inherited) lazy fields. If 'checkinit' + * for its own (non inherited) lazy fields. If 'checkinit' * is enabled, getters that check for the initialized bit are * generated, and the class constructor is changed to set the * initialized bits. diff --git a/src/compiler/scala/tools/nsc/transform/SampleTransform.scala b/src/compiler/scala/tools/nsc/transform/SampleTransform.scala index cffb483072..ba303f7c2b 100644 --- a/src/compiler/scala/tools/nsc/transform/SampleTransform.scala +++ b/src/compiler/scala/tools/nsc/transform/SampleTransform.scala @@ -27,7 +27,7 @@ abstract class SampleTransform extends Transform { tree1 match { case Block(List(), expr) => // a simple optimization expr - case Block(defs, sup @ Super(qual, mix)) => // A hypthothetic transformation, which replaces + case Block(defs, sup @ Super(qual, mix)) => // A hypothetical transformation, which replaces // {super} by {super.sample} treeCopy.Block( // `copy` is the usual lazy tree copier tree1, defs, diff --git a/src/compiler/scala/tools/nsc/transform/SpecializeTypes.scala b/src/compiler/scala/tools/nsc/transform/SpecializeTypes.scala index 086512677e..1a24c668ba 100644 --- a/src/compiler/scala/tools/nsc/transform/SpecializeTypes.scala +++ b/src/compiler/scala/tools/nsc/transform/SpecializeTypes.scala @@ -610,7 +610,7 @@ abstract class SpecializeTypes extends InfoTransform with TypingTransformers { exitingSpecialize(sClass setInfo specializedInfoType) val fullEnv = outerEnv ++ env - /* Enter 'sym' in the scope of the current specialized class. It's type is + /* Enter 'sym' in the scope of the current specialized class. Its type is * mapped through the active environment, binding type variables to concrete * types. The existing typeEnv for `sym` is composed with the current active * environment @@ -1368,7 +1368,7 @@ abstract class SpecializeTypes extends InfoTransform with TypingTransformers { ) def specializeCalls(unit: CompilationUnit) = new TypingTransformer(unit) { - /** Map a specializable method to it's rhs, when not deferred. */ + /** Map a specializable method to its rhs, when not deferred. */ val body = perRunCaches.newMap[Symbol, Tree]() /** Map a specializable method to its value parameter symbols. */ diff --git a/src/compiler/scala/tools/nsc/typechecker/AnalyzerPlugins.scala b/src/compiler/scala/tools/nsc/typechecker/AnalyzerPlugins.scala index 2c27bdb03a..0574869714 100644 --- a/src/compiler/scala/tools/nsc/typechecker/AnalyzerPlugins.scala +++ b/src/compiler/scala/tools/nsc/typechecker/AnalyzerPlugins.scala @@ -57,7 +57,7 @@ trait AnalyzerPlugins { self: Analyzer => * `analyzer.transformed` hash map, indexed by the definition's rhs tree. * * NOTE: Invoking the type checker can lead to cyclic reference errors. For instance, if this - * method is called from the type completer of a recursive method, type checking the mehtod + * method is called from the type completer of a recursive method, type checking the method * rhs will invoke the same completer again. It might be possible to avoid this situation by * assigning `tpe` to `defTree.symbol` (untested) - the final type computed by this method * will then be assigned to the definition's symbol by monoTypeCompleter (in Namers). diff --git a/src/compiler/scala/tools/nsc/typechecker/Contexts.scala b/src/compiler/scala/tools/nsc/typechecker/Contexts.scala index ca25e59c4b..542f58795a 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Contexts.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Contexts.scala @@ -167,7 +167,7 @@ trait Contexts { self: Analyzer => * afterwards errors are thrown. This is configured in `rootContext`. Additionally, more * fine grained control is needed based on the kind of error; ambiguity errors are often * suppressed during exploratory typing, such as determining whether `a == b` in an argument - * position is an assignment or a named argument, when `Infererencer#isApplicableSafe` type checks + * position is an assignment or a named argument, when `Inferencer#isApplicableSafe` type checks * applications with and without an expected type, or whtn `Typer#tryTypedApply` tries to fit arguments to * a function type with/without implicit views. * @@ -1108,10 +1108,10 @@ trait Contexts { self: Analyzer => // // A type-import-on-demand declaration never causes any other declaration to be shadowed. // - // Scala: Bindings of different kinds have a precedence defined on them: + // Scala: Bindings of different kinds have a precedence defined on them: // - // 1) Definitions and declarations that are local, inherited, or made available by a - // package clause in the same compilation unit where the definition occurs have + // 1) Definitions and declarations that are local, inherited, or made available by a + // package clause in the same compilation unit where the definition occurs have // highest precedence. // 2) Explicit imports have next highest precedence. def depthOk(imp: ImportInfo) = ( diff --git a/src/compiler/scala/tools/nsc/typechecker/Infer.scala b/src/compiler/scala/tools/nsc/typechecker/Infer.scala index 27e17fc65f..f9582a54ff 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Infer.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Infer.scala @@ -376,7 +376,7 @@ trait Infer extends Checkable { } /** Overload which allocates fresh type vars. * The other one exists because apparently inferExprInstance needs access to the typevars - * after the call, and its wasteful to return a tuple and throw it away almost every time. + * after the call, and it's wasteful to return a tuple and throw it away almost every time. */ private def exprTypeArgs(tparams: List[Symbol], restpe: Type, pt: Type, useWeaklyCompatible: Boolean): List[Type] = exprTypeArgs(tparams map freshVar, tparams, restpe, pt, useWeaklyCompatible) diff --git a/src/compiler/scala/tools/nsc/typechecker/Namers.scala b/src/compiler/scala/tools/nsc/typechecker/Namers.scala index 24238b8e41..77c49a862a 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Namers.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Namers.scala @@ -1125,7 +1125,7 @@ trait Namers extends MethodSynthesis { for (vparam <- vparams) { if (vparam.tpt.isEmpty) { val overriddenParamTp = overriddenParams.head.tpe - // references to type parameteres in overriddenParamTp link to the type skolems, so the + // references to type parameters in overriddenParamTp link to the type skolems, so the // assigned type is consistent with the other / existing parameter types in vparamSymss. vparam.symbol setInfo overriddenParamTp vparam.tpt defineType overriddenParamTp setPos vparam.pos.focus diff --git a/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala b/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala index 5abfbe850f..a3a4c70d1e 100644 --- a/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala +++ b/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala @@ -584,7 +584,7 @@ abstract class RefChecks extends InfoTransform with scala.reflect.internal.trans !other.isDeferred && other.isJavaDefined && !sym.enclClass.isSubClass(other.enclClass) && { // #3622: erasure operates on uncurried types -- // note on passing sym in both cases: only sym.isType is relevant for uncurry.transformInfo - // !!! erasure.erasure(sym, uncurry.transformInfo(sym, tp)) gives erreneous of inaccessible type - check whether that's still the case! + // !!! erasure.erasure(sym, uncurry.transformInfo(sym, tp)) gives erroneous or inaccessible type - check whether that's still the case! def uncurryAndErase(tp: Type) = erasure.erasure(sym)(uncurry.transformInfo(sym, tp)) val tp1 = uncurryAndErase(clazz.thisType.memberType(sym)) val tp2 = uncurryAndErase(clazz.thisType.memberType(other)) diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala index 7417c5364e..27a574a449 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala @@ -4301,7 +4301,7 @@ trait Typers extends Adaptations with Tags with TypersTracking with PatternTyper val selector1 = atPos(tree.pos.focusStart) { if (arity == 1) ids.head else gen.mkTuple(ids) } // SI-8120 If we don't duplicate the cases, the original Match node will share trees with ones that // receive symbols owned by this function. However if, after a silent mode session, we discard - // this Function and try a different approach (e.g. applying a view to the reciever) we end up + // this Function and try a different approach (e.g. applying a view to the receiver) we end up // with orphaned symbols which blows up far down the pipeline (or can be detected with -Ycheck:typer). val body = treeCopy.Match(tree, selector1, (cases map duplicateAndKeepPositions).asInstanceOf[List[CaseDef]]) typed1(atPos(tree.pos) { Function(params, body) }, mode, pt) -- cgit v1.2.3