From 910a18ed14dd81150f008e785f8773bf997eb1f6 Mon Sep 17 00:00:00 2001
From: Dongjoon Hyun
Marks a formal parameter name as deprecated. Invocations of this entity
- using named parameter syntax refering to the deprecated parameter name cause a deprecation warning.
+ using named parameter syntax referring to the deprecated parameter name cause a deprecation warning.
### Scala Compiler Annotations
diff --git a/spec/15-changelog.md b/spec/15-changelog.md
index 751a571ecc..c88408682b 100644
--- a/spec/15-changelog.md
+++ b/spec/15-changelog.md
@@ -441,7 +441,7 @@ In the example, `Twice` is an extractor object with two methods:
- The `unapply` method is used to decompose an even number; it is in a sense
the reverse of `apply`. `unapply` methods return option types:
- `Some(...)` for a match that suceeds, `None` for a match that fails.
+ `Some(...)` for a match that succeeds, `None` for a match that fails.
Pattern variables are returned as the elements of `Some`.
If there are several variables, they are grouped in a tuple.
@@ -532,7 +532,7 @@ In particular, one can now simulate package protected access as in Java writing
where would name the package containing `X`.
-#### Relaxation of Private Acess
+#### Relaxation of Private Access
[Private members of a class](05-classes-and-objects.html#private) can now be
referenced from the companion module of the class and vice versa.
diff --git a/src/compiler/scala/tools/nsc/backend/jvm/CoreBTypes.scala b/src/compiler/scala/tools/nsc/backend/jvm/CoreBTypes.scala
index 3617f3d863..696a164c56 100644
--- a/src/compiler/scala/tools/nsc/backend/jvm/CoreBTypes.scala
+++ b/src/compiler/scala/tools/nsc/backend/jvm/CoreBTypes.scala
@@ -11,7 +11,7 @@ import scala.tools.nsc.backend.jvm.BTypes.InternalName
*
* The symbols used to initialize the ClassBTypes may change from one compiler run to the next. To
* make sure the definitions are consistent with the symbols in the current run, the
- * `intializeCoreBTypes` method in BTypesFromSymbols creates a new instance of CoreBTypes in each
+ * `initializeCoreBTypes` method in BTypesFromSymbols creates a new instance of CoreBTypes in each
* compiler run.
*
* The class BTypesFromSymbols does not directly reference CoreBTypes, but CoreBTypesProxy. The
diff --git a/src/compiler/scala/tools/nsc/backend/jvm/analysis/BackendUtils.scala b/src/compiler/scala/tools/nsc/backend/jvm/analysis/BackendUtils.scala
index 0d6ef93a26..bd7d5d2608 100644
--- a/src/compiler/scala/tools/nsc/backend/jvm/analysis/BackendUtils.scala
+++ b/src/compiler/scala/tools/nsc/backend/jvm/analysis/BackendUtils.scala
@@ -273,7 +273,7 @@ class BackendUtils[BT <: BTypes](val btypes: BT) {
}
// we are only interested in the class references in the descriptor, so we can skip over
- // primitves and the brackets of array descriptors
+ // primitives and the brackets of array descriptors
def visitDescriptor(desc: String): Unit = (desc.charAt(0): @switch) match {
case '(' =>
val internalNames = mutable.ListBuffer.empty[String]
@@ -455,7 +455,7 @@ class BackendUtils[BT <: BTypes](val btypes: BT) {
insn match {
case v: VarInsnNode =>
val longSize = if (isSize2LoadOrStore(v.getOpcode)) 1 else 0
- maxLocals = math.max(maxLocals, v.`var` + longSize + 1) // + 1 becauase local numbers are 0-based
+ maxLocals = math.max(maxLocals, v.`var` + longSize + 1) // + 1 because local numbers are 0-based
case i: IincInsnNode =>
maxLocals = math.max(maxLocals, i.`var` + 1)
diff --git a/src/compiler/scala/tools/nsc/backend/jvm/analysis/ProdConsAnalyzerImpl.scala b/src/compiler/scala/tools/nsc/backend/jvm/analysis/ProdConsAnalyzerImpl.scala
index 894799bf36..419c686bd8 100644
--- a/src/compiler/scala/tools/nsc/backend/jvm/analysis/ProdConsAnalyzerImpl.scala
+++ b/src/compiler/scala/tools/nsc/backend/jvm/analysis/ProdConsAnalyzerImpl.scala
@@ -441,10 +441,10 @@ trait ProdConsAnalyzerImpl {
* return a;
* }
*
- * In the first frame of the method, the SoruceValue for parameter `a` gives an empty set of
+ * In the first frame of the method, the SourceValue for parameter `a` gives an empty set of
* producer instructions.
*
- * In the frame of the `IRETURN` instruction, the SoruceValue for parameter `a` lists a single
+ * In the frame of the `IRETURN` instruction, the SourceValue for parameter `a` lists a single
* producer instruction: the `ISTORE 1`. This makes it look as if there was a single producer for
* `a`, where in fact it might still hold the parameter's initial value.
*/
diff --git a/src/compiler/scala/tools/nsc/backend/jvm/analysis/package.scala b/src/compiler/scala/tools/nsc/backend/jvm/analysis/package.scala
index f1ac703532..ef961941a0 100644
--- a/src/compiler/scala/tools/nsc/backend/jvm/analysis/package.scala
+++ b/src/compiler/scala/tools/nsc/backend/jvm/analysis/package.scala
@@ -43,7 +43,7 @@ package scala.tools.nsc.backend.jvm
* - Stores a frame for each instruction
* - `merge` function takes an instruction and a frame, merges the existing frame for that instr
* (from the frames array) with the new frame passed as argument.
- * if the frame changed, puts the instruction on the work queue (fixpiont).
+ * if the frame changed, puts the instruction on the work queue (fixpoint).
* - initial frame: initialized for first instr by calling interpreter.new[...]Value
* for each slot (locals and params), stored in frames[firstInstr] by calling `merge`
* - work queue of instructions (`queue` array, `top` index for next instruction to analyze)
@@ -191,7 +191,7 @@ package scala.tools.nsc.backend.jvm
* I measured nullness analysis (which tracks aliases) and a SimpleValue analysis. Nullness runs
* roughly 5x slower (because of alias tracking) at every problem size - this factor doesn't change.
*
- * The numbers below are for nullness. Note that the the last column is constant, i.e., the running
+ * The numbers below are for nullness. Note that the last column is constant, i.e., the running
* time is proportional to #ins * #loc^2. Therefore we use this factor when limiting the maximal
* method size for running an analysis.
*
diff --git a/src/compiler/scala/tools/nsc/backend/jvm/opt/ClosureOptimizer.scala b/src/compiler/scala/tools/nsc/backend/jvm/opt/ClosureOptimizer.scala
index 58054f85ad..4935b9d1a0 100644
--- a/src/compiler/scala/tools/nsc/backend/jvm/opt/ClosureOptimizer.scala
+++ b/src/compiler/scala/tools/nsc/backend/jvm/opt/ClosureOptimizer.scala
@@ -156,7 +156,7 @@ class ClosureOptimizer[BT <: BTypes](val btypes: BT) {
// TODO: This is maybe over-cautious.
// We are checking if the closure body method is accessible at the closure callsite.
// If the closure allocation has access to the body method, then the callsite (in the same
- // method as the alloction) should have access too.
+ // method as the allocation) should have access too.
val bodyAccessible: Either[OptimizerWarning, Boolean] = for {
(bodyMethodNode, declClass) <- byteCodeRepository.methodNode(lambdaBodyHandle.getOwner, lambdaBodyHandle.getName, lambdaBodyHandle.getDesc): Either[OptimizerWarning, (MethodNode, InternalName)]
isAccessible <- inliner.memberIsAccessible(bodyMethodNode.access, classBTypeFromParsedClassfile(declClass), classBTypeFromParsedClassfile(lambdaBodyHandle.getOwner), ownerClass)
diff --git a/src/compiler/scala/tools/nsc/backend/jvm/opt/CopyProp.scala b/src/compiler/scala/tools/nsc/backend/jvm/opt/CopyProp.scala
index f91530903d..f1eaebd27c 100644
--- a/src/compiler/scala/tools/nsc/backend/jvm/opt/CopyProp.scala
+++ b/src/compiler/scala/tools/nsc/backend/jvm/opt/CopyProp.scala
@@ -52,7 +52,7 @@ class CopyProp[BT <: BTypes](val btypes: BT) {
var r = init
while (it.hasNext) {
val n = it.next()
- // knownUsed.lenght is the number of locals, `n` may be a stack slot
+ // knownUsed.length is the number of locals, `n` may be a stack slot
if (n < knownUsed.length && knownUsed(n)) return n
if (n < r) r = n
}
@@ -171,7 +171,7 @@ class CopyProp[BT <: BTypes](val btypes: BT) {
*
* A special case eliminates the creation of unused objects with side-effect-free constructors:
* NEW scala/Tuple1; DUP; ALOAD 0; INVOKESPECIAL scala/Tuple1.
* This phase has been moved before pattern matching to catch more diff --git a/src/compiler/scala/tools/nsc/transform/patmat/PatternMatching.scala b/src/compiler/scala/tools/nsc/transform/patmat/PatternMatching.scala index b2f2516b5b..05f2d60be1 100644 --- a/src/compiler/scala/tools/nsc/transform/patmat/PatternMatching.scala +++ b/src/compiler/scala/tools/nsc/transform/patmat/PatternMatching.scala @@ -222,7 +222,7 @@ trait Interface extends ast.TreeDSL { object substIdentsForTrees extends Transformer { private def typedIfOrigTyped(to: Tree, origTp: Type): Tree = if (origTp == null || origTp == NoType) to - // important: only type when actually substing and when original tree was typed + // important: only type when actually substituting and when original tree was typed // (don't need to use origTp as the expected type, though, and can't always do this anyway due to unknown type params stemming from polymorphic extractors) else typer.typed(to) diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala index 6676a0aeaf..24da2d09c5 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala @@ -3155,7 +3155,7 @@ trait Typers extends Adaptations with Tags with TypersTracking with PatternTyper if (phase.erasedTypes) stats1 else { // As packages are open, it doesn't make sense to check double definitions here. Furthermore, - // it is expensive if the package is large. Instead, such double defininitions are checked in `Namers.enterInScope` + // it is expensive if the package is large. Instead, such double definitions are checked in `Namers.enterInScope` if (!context.owner.isPackageClass) checkNoDoubleDefs addSynthetics(stats1) diff --git a/src/library/scala/concurrent/impl/Promise.scala b/src/library/scala/concurrent/impl/Promise.scala index 178cd6d912..626540425f 100644 --- a/src/library/scala/concurrent/impl/Promise.scala +++ b/src/library/scala/concurrent/impl/Promise.scala @@ -304,7 +304,7 @@ private[concurrent] object Promise { /** Tries to add the callback, if already completed, it dispatches the callback to be executed. * Used by `onComplete()` to add callbacks to a promise and by `link()` to transfer callbacks - * to the root promise when linking two promises togehter. + * to the root promise when linking two promises together. */ @tailrec private def dispatchOrAddCallback(runnable: CallbackRunnable[T]): Unit = { diff --git a/src/reflect/scala/reflect/internal/Positions.scala b/src/reflect/scala/reflect/internal/Positions.scala index 15d68bcdfe..95b3b7fb14 100644 --- a/src/reflect/scala/reflect/internal/Positions.scala +++ b/src/reflect/scala/reflect/internal/Positions.scala @@ -254,7 +254,7 @@ trait Positions extends api.Positions { self: SymbolTable => case mdef: MemberDef => val annTrees = mdef.mods.annotations match { case Nil if mdef.symbol != null => - // After typechecking, annotations are mvoed from the modifiers + // After typechecking, annotations are moved from the modifiers // to the annotation on the symbol of the anotatee. mdef.symbol.annotations.map(_.original) case anns => anns diff --git a/src/reflect/scala/reflect/internal/Reporting.scala b/src/reflect/scala/reflect/internal/Reporting.scala index 2534f59c97..afdae81289 100644 --- a/src/reflect/scala/reflect/internal/Reporting.scala +++ b/src/reflect/scala/reflect/internal/Reporting.scala @@ -9,7 +9,7 @@ package internal /** Provides delegates to the reporter doing the actual work. * All forwarding methods should be marked final, - * but some subclasses out of our reach stil override them. + * but some subclasses out of our reach still override them. * * Eventually, this interface should be reduced to one method: `reporter`, * and clients should indirect themselves (reduce duplication of forwarders). diff --git a/src/reflect/scala/reflect/internal/util/WeakHashSet.scala b/src/reflect/scala/reflect/internal/util/WeakHashSet.scala index fffe4dd881..412b14d329 100644 --- a/src/reflect/scala/reflect/internal/util/WeakHashSet.scala +++ b/src/reflect/scala/reflect/internal/util/WeakHashSet.scala @@ -223,7 +223,7 @@ final class WeakHashSet[A <: AnyRef](val initialCapacity: Int, val loadFactor: D def +=(elem: A) = this + elem - // from scala.reflect.interanl.Set + // from scala.reflect.internal.Set override def addEntry(x: A) { this += x } // remove an element from this set and return this set diff --git a/src/repl/scala/tools/nsc/interpreter/PresentationCompilation.scala b/src/repl/scala/tools/nsc/interpreter/PresentationCompilation.scala index 3a2177a4cb..c8cd201bf5 100644 --- a/src/repl/scala/tools/nsc/interpreter/PresentationCompilation.scala +++ b/src/repl/scala/tools/nsc/interpreter/PresentationCompilation.scala @@ -78,7 +78,7 @@ trait PresentationCompilation { abstract class PresentationCompileResult { val compiler: scala.tools.nsc.interactive.Global def unit: compiler.RichCompilationUnit - /** The length of synthetic code the precedes the user writtn code */ + /** The length of synthetic code the precedes the user written code */ def preambleLength: Int def cleanup(): Unit = { compiler.askShutdown() diff --git a/src/scaladoc/scala/tools/nsc/doc/base/comment/Comment.scala b/src/scaladoc/scala/tools/nsc/doc/base/comment/Comment.scala index eeb861e246..5d0b6782bc 100644 --- a/src/scaladoc/scala/tools/nsc/doc/base/comment/Comment.scala +++ b/src/scaladoc/scala/tools/nsc/doc/base/comment/Comment.scala @@ -63,7 +63,7 @@ abstract class Comment { /** A list of other resources to see, including links to other entities or * to external documentation. The empty list is used when no other resource - * is mentionned. */ + * is mentioned. */ def see: List[Body] /** A description of the result of the entity. Typically, this provides additional diff --git a/src/scaladoc/scala/tools/nsc/doc/model/Entity.scala b/src/scaladoc/scala/tools/nsc/doc/model/Entity.scala index 524f94443d..757f13f79a 100644 --- a/src/scaladoc/scala/tools/nsc/doc/model/Entity.scala +++ b/src/scaladoc/scala/tools/nsc/doc/model/Entity.scala @@ -455,7 +455,7 @@ trait ValueParam extends ParameterEntity { /** The type of this value parameter. */ def resultType: TypeEntity - /** The devault value of this value parameter, if it has been defined. */ + /** The default value of this value parameter, if it has been defined. */ def defaultValue: Option[TreeEntity] /** Whether this value parameter is implicit. */ diff --git a/src/scaladoc/scala/tools/nsc/doc/model/ModelFactory.scala b/src/scaladoc/scala/tools/nsc/doc/model/ModelFactory.scala index bccb65aa5f..928cb34d30 100644 --- a/src/scaladoc/scala/tools/nsc/doc/model/ModelFactory.scala +++ b/src/scaladoc/scala/tools/nsc/doc/model/ModelFactory.scala @@ -51,7 +51,7 @@ class ModelFactory(val global: Global, val settings: doc.Settings) { lazy val dotRunner = new DotRunner(settings) } _modelFinished = true - // complete the links between model entities, everthing that couldn't have been done before + // complete the links between model entities, everything that couldn't have been done before universe.rootPackage.completeModel() Some(universe) filter (_.rootPackage != null) diff --git a/src/scaladoc/scala/tools/nsc/doc/model/diagram/DiagramDirectiveParser.scala b/src/scaladoc/scala/tools/nsc/doc/model/diagram/DiagramDirectiveParser.scala index 3b7eb4e947..464cacc99a 100644 --- a/src/scaladoc/scala/tools/nsc/doc/model/diagram/DiagramDirectiveParser.scala +++ b/src/scaladoc/scala/tools/nsc/doc/model/diagram/DiagramDirectiveParser.scala @@ -163,7 +163,7 @@ trait DiagramDirectiveParser { case Nil => defaultFilter - // compute the exact filters. By including the annotation, the diagram is autmatically added + // compute the exact filters. By including the annotation, the diagram is automatically added case _ => tFilter -= System.currentTimeMillis var hideDiagram0: Boolean = false diff --git a/src/scaladoc/scala/tools/nsc/doc/model/diagram/DiagramFactory.scala b/src/scaladoc/scala/tools/nsc/doc/model/diagram/DiagramFactory.scala index 86900f26c9..bbcb18353a 100644 --- a/src/scaladoc/scala/tools/nsc/doc/model/diagram/DiagramFactory.scala +++ b/src/scaladoc/scala/tools/nsc/doc/model/diagram/DiagramFactory.scala @@ -63,7 +63,7 @@ trait DiagramFactory extends DiagramDirectiveParser { case d: TemplateImpl if !classExcluded(d) => NormalNode(makeType(d.sym.tpe, tpl), Some(d))() }.sortBy(_.tpl.get.name)(implicitly[Ordering[String]].reverse) - // outgoing implicit coversions + // outgoing implicit conversions lazy val outgoingImplicitNodes = tpl.outgoingImplicitlyConvertedClasses.map { case (outgoingTpl, outgoingType, conv) => ImplicitNode(outgoingType, Some(outgoingTpl))(implicitTooltip(from=tpl, to=tpl, conv=conv)) diff --git a/test/files/presentation/scope-completion-3/src/Completions.scala b/test/files/presentation/scope-completion-3/src/Completions.scala index 18cef1cefa..8d79adc669 100644 --- a/test/files/presentation/scope-completion-3/src/Completions.scala +++ b/test/files/presentation/scope-completion-3/src/Completions.scala @@ -1,6 +1,6 @@ package test -/* check availability of members defined locally and in hierachy */ +/* check availability of members defined locally and in hierarchy */ abstract class Base1 { -- cgit v1.2.3