From 31ae74f2dd649bd67457492af6305b92a8ea9cf6 Mon Sep 17 00:00:00 2001 From: Michał Pociecha Date: Sat, 22 Aug 2015 01:02:46 +0200 Subject: Fix typos in spec, docs and comments --- docs/TODO | 2 +- spec/01-lexical-syntax.md | 2 +- spec/06-expressions.md | 2 +- spec/07-implicits.md | 2 +- spec/12-the-scala-standard-library.md | 6 +++--- spec/15-changelog.md | 4 ++-- src/actors/scala/actors/Future.scala | 2 +- src/compiler/scala/tools/nsc/ast/TreeGen.scala | 2 +- src/compiler/scala/tools/nsc/backend/icode/GenICode.scala | 4 ++-- src/compiler/scala/tools/nsc/backend/icode/ICodeCheckers.scala | 2 +- src/compiler/scala/tools/nsc/backend/jvm/BCodeBodyBuilder.scala | 4 ++-- src/compiler/scala/tools/nsc/backend/jvm/BTypes.scala | 2 +- .../scala/tools/nsc/backend/jvm/analysis/NullnessAnalyzer.scala | 2 +- src/compiler/scala/tools/nsc/backend/jvm/opt/ClosureOptimizer.scala | 2 +- src/compiler/scala/tools/nsc/backend/jvm/opt/Inliner.scala | 2 +- src/compiler/scala/tools/nsc/transform/Constructors.scala | 2 +- src/compiler/scala/tools/nsc/typechecker/Macros.scala | 2 +- src/compiler/scala/tools/nsc/typechecker/Typers.scala | 6 +++--- src/forkjoin/scala/concurrent/forkjoin/ThreadLocalRandom.java | 2 +- src/library/scala/util/Sorting.scala | 2 +- src/reflect/scala/reflect/api/Types.scala | 2 +- src/reflect/scala/reflect/internal/Kinds.scala | 2 +- src/reflect/scala/reflect/internal/Symbols.scala | 2 +- src/reflect/scala/reflect/internal/Trees.scala | 2 +- src/scaladoc/scala/tools/nsc/doc/html/page/Template.scala | 2 +- test/files/neg/name-lookup-stable.check | 2 +- test/files/neg/name-lookup-stable.scala | 2 +- test/files/neg/t5376.scala | 2 +- test/files/neg/t8597b.scala | 2 +- test/files/neg/t8675b.scala | 2 +- test/files/neg/virtpatmat_exhaust_compound.scala | 2 +- test/files/pos/t2405.scala | 4 ++-- test/files/pos/t8002-nested-scope.scala | 2 +- test/files/run/dead-code-elimination.scala | 2 +- test/files/run/names-defaults.scala | 2 +- test/files/run/nothingTypeNoOpt.scala | 2 +- test/files/run/t8047.scala | 2 +- .../scala/tools/nsc/backend/jvm/analysis/ProdConsAnalyzerTest.scala | 2 +- versions.properties | 2 +- 39 files changed, 47 insertions(+), 47 deletions(-) diff --git a/docs/TODO b/docs/TODO index 094202f53e..558aa87205 100644 --- a/docs/TODO +++ b/docs/TODO @@ -53,7 +53,7 @@ The process is about the same for symbols in PolyTypes. The main difference is that type parameters may be referenced and thus we - need something like De Bruijn indicies to represent these + need something like De Bruijn indices to represent these references. diff --git a/spec/01-lexical-syntax.md b/spec/01-lexical-syntax.md index e26cb796c8..b26e5b2328 100644 --- a/spec/01-lexical-syntax.md +++ b/spec/01-lexical-syntax.md @@ -443,7 +443,7 @@ multiLineChars ::= {[‘"’] [‘"’] charNoDoubleQuote} {‘"’} A multi-line string literal is a sequence of characters enclosed in triple quotes `""" ... """`. The sequence of characters is -arbitrary, except that it may contain three or more consuctive quote characters +arbitrary, except that it may contain three or more consecutive quote characters only at the very end. Characters must not necessarily be printable; newlines or other control characters are also permitted. Unicode escapes work as everywhere else, but none diff --git a/spec/06-expressions.md b/spec/06-expressions.md index 85e288bf5f..9cd58ea346 100644 --- a/spec/06-expressions.md +++ b/spec/06-expressions.md @@ -1736,7 +1736,7 @@ so `scala.Any` is the type inferred for `a`. _Eta-expansion_ converts an expression of method type to an equivalent expression of function type. It proceeds in two steps. -First, one identifes the maximal sub-expressions of $e$; let's +First, one identifies the maximal sub-expressions of $e$; let's say these are $e_1 , \ldots , e_m$. For each of these, one creates a fresh name $x_i$. Let $e'$ be the expression resulting from replacing every maximal subexpression $e_i$ in $e$ by the diff --git a/spec/07-implicits.md b/spec/07-implicits.md index 5e10373959..726320ed33 100644 --- a/spec/07-implicits.md +++ b/spec/07-implicits.md @@ -84,7 +84,7 @@ The _parts_ of a type $T$ are: - if $T$ is an abstract type, the parts of its upper bound; - if $T$ denotes an implicit conversion to a type with a method with argument types $T_1 , \ldots , T_n$ and result type $U$, the union of the parts of $T_1 , \ldots , T_n$ and $U$; -- the parts of quantified (existential or univeral) and annotated types are defined as the parts of the underlying types (e.g., the parts of `T forSome { ... }` are the parts of `T`); +- the parts of quantified (existential or universal) and annotated types are defined as the parts of the underlying types (e.g., the parts of `T forSome { ... }` are the parts of `T`); - in all other cases, just $T$ itself. Note that packages are internally represented as classes with companion modules to hold the package members. diff --git a/spec/12-the-scala-standard-library.md b/spec/12-the-scala-standard-library.md index e76035f458..8f65191312 100644 --- a/spec/12-the-scala-standard-library.md +++ b/spec/12-the-scala-standard-library.md @@ -171,7 +171,7 @@ Any numeric value type $T$ supports the following methods. evaluated by converting the receiver and its argument to their operation type and performing the given arithmetic operation of that type. - * Parameterless arithmethic methods identity (`+`) and negation + * Parameterless arithmetic methods identity (`+`) and negation (`-`), with result type $T$. The first of these returns the receiver unchanged, whereas the second returns its negation. * Conversion methods `toByte`, `toShort`, `toChar`, @@ -194,7 +194,7 @@ Integer numeric value types support in addition the following operations: operation of that type. * A parameterless bit-negation method (`~`). Its result type is - the reciver type $T$ or `Int`, whichever is larger. + the receiver type $T$ or `Int`, whichever is larger. The operation is evaluated by converting the receiver to the result type and negating every bit in its value. * Bit-shift methods left-shift (`<<`), arithmetic right-shift @@ -745,7 +745,7 @@ object Predef { def readf2(format: String) = Console.readf2(format) def readf3(format: String) = Console.readf3(format) - // Implict conversions ------------------------------------------------ + // Implicit conversions ------------------------------------------------ ... } diff --git a/spec/15-changelog.md b/spec/15-changelog.md index 3c8739359a..751a571ecc 100644 --- a/spec/15-changelog.md +++ b/spec/15-changelog.md @@ -31,7 +31,7 @@ formal parameter types. Added section on [numeric widening](06-expressions.html#numeric-widening) to support weak conformance. -Tightened rules to avoid accidential [overrides](05-classes-and-objects.html#overriding). +Tightened rules to avoid accidental [overrides](05-classes-and-objects.html#overriding). Removed class literals. @@ -53,7 +53,7 @@ has been brought in line with. From now on `+=`, has the same precedence as `=`. #### Wildcards as function parameters -A formal parameter to an anonymous fucntion may now be a +A formal parameter to an anonymous function may now be a [wildcard represented by an underscore](06-expressions.html#placeholder-syntax-for-anonymous-functions). > _ => 7 // The function that ignores its argument diff --git a/src/actors/scala/actors/Future.scala b/src/actors/scala/actors/Future.scala index 4421c7a07a..11602f52a2 100644 --- a/src/actors/scala/actors/Future.scala +++ b/src/actors/scala/actors/Future.scala @@ -12,7 +12,7 @@ package scala.actors import scala.actors.scheduler.DaemonScheduler import scala.concurrent.SyncVar -/** A function of arity 0, returing a value of type `T` that, +/** A function of arity 0, returning a value of type `T` that, * when applied, blocks the current actor (`Actor.self`) * until the future's value is available. * diff --git a/src/compiler/scala/tools/nsc/ast/TreeGen.scala b/src/compiler/scala/tools/nsc/ast/TreeGen.scala index bf53c47e9a..332acf4a26 100644 --- a/src/compiler/scala/tools/nsc/ast/TreeGen.scala +++ b/src/compiler/scala/tools/nsc/ast/TreeGen.scala @@ -261,7 +261,7 @@ abstract class TreeGen extends scala.reflect.internal.TreeGen with TreeDSL { * Create a method based on a Function * * Used both to under `-Ydelambdafy:method` create a lifted function and - * under `-Ydelamdafy:inline` to create the apply method on the anonymous + * under `-Ydelambdafy:inline` to create the apply method on the anonymous * class. * * It creates a method definition with value params cloned from the diff --git a/src/compiler/scala/tools/nsc/backend/icode/GenICode.scala b/src/compiler/scala/tools/nsc/backend/icode/GenICode.scala index 3e23291e92..b6f9bcc9ab 100644 --- a/src/compiler/scala/tools/nsc/backend/icode/GenICode.scala +++ b/src/compiler/scala/tools/nsc/backend/icode/GenICode.scala @@ -2016,7 +2016,7 @@ abstract class GenICode extends SubComponent { * * This could result in unreachable code which has to be cleaned up later, e.g. if the try and all the exception * handlers always end in RETURN then there will be no "normal" flow out of the try/catch/finally. - * Later reachability analysis will remove unreacahble code. + * Later reachability analysis will remove unreachable code. */ def Try(body: Context => Context, handlers: List[(Symbol, TypeKind, Context => Context)], @@ -2060,7 +2060,7 @@ abstract class GenICode extends SubComponent { if (settings.YdisableUnreachablePrevention || !outerCtx.bb.ignore) { if (finalizer != EmptyTree) { val exh = outerCtx.newExceptionHandler(NoSymbol, finalizer.pos) // finalizer covers exception handlers - this.addActiveHandler(exh) // .. and body aswell + this.addActiveHandler(exh) // .. and body as well val exhStartCtx = finalizerCtx.enterExceptionHandler(exh) exhStartCtx.bb killIf outerCtx.bb.ignore val exception = exhStartCtx.makeLocal(finalizer.pos, ThrowableTpe, "exc") diff --git a/src/compiler/scala/tools/nsc/backend/icode/ICodeCheckers.scala b/src/compiler/scala/tools/nsc/backend/icode/ICodeCheckers.scala index 843648282b..0f17b5d694 100644 --- a/src/compiler/scala/tools/nsc/backend/icode/ICodeCheckers.scala +++ b/src/compiler/scala/tools/nsc/backend/icode/ICodeCheckers.scala @@ -20,7 +20,7 @@ abstract class ICodeCheckers { *

*