Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix misspelled words in comments and error messages
  • Loading branch information
seratch committed Aug 10, 2018
1 parent 72fd1cb commit fd2b180
Show file tree
Hide file tree
Showing 56 changed files with 69 additions and 69 deletions.
Expand Up @@ -626,7 +626,7 @@ class DottyBackendInterface(outputDirectory: AbstractFile, val superCallsMap: Ma

def symbol: Symbol = a.tree.symbol

def args: List[Tree] = List.empty // those arguments to scala-defined annotations. they are never emmited
def args: List[Tree] = List.empty // those arguments to scala-defined annotations. they are never emmitted
}

def assocsFromApply(tree: Tree): List[(Name, Tree)] = {
Expand Down Expand Up @@ -810,7 +810,7 @@ class DottyBackendInterface(outputDirectory: AbstractFile, val superCallsMap: Ma
def annotations: List[Annotation] = toDenot(sym).annotations
def companionModuleMembers: List[Symbol] = {
// phase travel to exitingPickler: this makes sure that memberClassesOf only sees member classes,
// not local classes of the companion module (E in the exmaple) that were lifted by lambdalift.
// not local classes of the companion module (E in the example) that were lifted by lambdalift.
if (linkedClass.isTopLevelModuleClass) /*exitingPickler*/ linkedClass.memberClasses
else Nil
}
Expand Down
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/Driver.scala
Expand Up @@ -118,7 +118,7 @@ class Driver extends DotClass {
*
* In most cases, you do not need a custom `Context` and should
* instead use one of the other overloads of `process`. However,
* the other overloads cannot be overriden, instead you
* the other overloads cannot be overridden, instead you
* should override this one which they call internally.
*
* Usage example: [[https://github.com/lampepfl/dotty/tree/master/test/test/OtherEntryPointsTest.scala]]
Expand Down
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/ast/Positioned.scala
Expand Up @@ -168,7 +168,7 @@ abstract class Positioned extends DotClass with Product {
def check(p: Any): Unit = p match {
case p: Positioned =>
assert(pos contains p.pos,
s"""position error, parent position does not contain child positon
s"""position error, parent position does not contain child position
|parent = $this,
|parent position = $pos,
|child = $p,
Expand Down
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/ast/tpd.scala
Expand Up @@ -1017,7 +1017,7 @@ object tpd extends Trees.Instance[Type] with TypedTreeInfo {
lastParam.tpe match {
case defn.ArrayOf(el2) if el2 <:< el =>
// we have a JavaSeqLiteral with a more precise type
// we cannot construct a tree as JavaSeqLiteral infered to precise type
// we cannot construct a tree as JavaSeqLiteral inferred to precise type
// if we add typed than it would be both type-correct and
// will pass Ycheck
prefix ::: List(tpd.Typed(lastParam, TypeTree(defn.ArrayOf(el))))
Expand Down
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/config/Config.scala
Expand Up @@ -120,7 +120,7 @@ object Config {

/** If this flag is set, it is checked that class type parameters are
* only references with NoPrefix or ThisTypes as prefixes. This option
* is usally disabled, because there are still some legitimate cases where
* is usually disabled, because there are still some legitimate cases where
* this can arise (e.g. for pos/Map.scala, in LambdaType.integrate).
*/
final val checkTypeParamRefs = false
Expand Down
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/core/Definitions.scala
Expand Up @@ -1233,7 +1233,7 @@ class Definitions {
// Temporary measure, as long as we do not read these classes from Tasty.
// Scala-2 classes don't have NoInits set even if they are pure. We override this
// for Product and Serializable so that case classes can be pure. A full solution
// requiers that we read all Scala code from Tasty.
// requires that we read all Scala code from Tasty.
ProductClass.setFlag(NoInits)
SerializableClass.setFlag(NoInits)

Expand Down
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/core/SymDenotations.scala
Expand Up @@ -1068,7 +1068,7 @@ object SymDenotations {
if (!canMatchInheritedSymbols && (owner ne inClass)) NoSymbol
else matchingDecl(inClass, owner.thisType)

/** All symbols overriden by this denotation. */
/** All symbols overridden by this denotation. */
final def allOverriddenSymbols(implicit ctx: Context): Iterator[Symbol] =
if (!canMatchInheritedSymbols) Iterator.empty
else overriddenFromType(owner.info)
Expand Down
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/core/TypeErasure.scala
Expand Up @@ -350,7 +350,7 @@ class TypeErasure(isJava: Boolean, semiEraseVCs: Boolean, isConstructor: Boolean
* - For a refined type scala.Array+[T]:
* - if T is Nothing or Null, []Object
* - otherwise, if T <: Object, []|T|
* - otherwise, if T is a type paramter coming from Java, []Object
* - otherwise, if T is a type parameter coming from Java, []Object
* - otherwise, Object
* - For a term ref p.x, the type <noprefix> # x.
* - For a typeref scala.Any, scala.AnyVal or scala.Singleton: |java.lang.Object|
Expand Down
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/core/tasty/TastyFormat.scala
Expand Up @@ -274,7 +274,7 @@ object TastyFormat {

final val OBJECTCLASS = 23 // The name of an object class (or: module class) `<name>$`.

final val SIGNED = 63 // A pair of a name and a signature, used to idenitfy
final val SIGNED = 63 // A pair of a name and a signature, used to idenitify
// possibly overloaded methods.
}
object NameTags extends NameTags
Expand Down
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/parsing/Parsers.scala
Expand Up @@ -262,7 +262,7 @@ object Parsers {
def deprecationWarning(msg: => Message, offset: Int = in.offset) =
ctx.deprecationWarning(msg, source atPos Position(offset))

/** Issue an error at current offset taht input is incomplete */
/** Issue an error at current offset that input is incomplete */
def incompleteInputError(msg: => Message) =
ctx.incompleteInputError(msg, source atPos Position(in.offset))

Expand Down
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/printing/Formatting.scala
Expand Up @@ -244,7 +244,7 @@ object Formatting {
* ```
* found: List[Int]
* required: List[T]
* where: T is a type in the initalizer of value s which is an alias of
* where: T is a type in the initializer of value s which is an alias of
* String
* ```
*
Expand Down
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/printing/PlainPrinter.scala
Expand Up @@ -435,7 +435,7 @@ class PlainPrinter(_ctx: Context) extends Printer {
else if (ownr.isAnonymousFunction) nextOuter("function")
else if (isEmptyPrefix(ownr)) ""
else if (ownr.isLocalDummy) showLocation(ownr.owner, "locally defined in")
else if (ownr.isTerm && !ownr.is(Module | Method)) showLocation(ownr, "in the initalizer of")
else if (ownr.isTerm && !ownr.is(Module | Method)) showLocation(ownr, "in the initializer of")
else showLocation(ownr, "in")
}
recur(sym.owner, "")
Expand Down
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/printing/Printer.scala
Expand Up @@ -34,7 +34,7 @@ abstract class Printer {
def changePrec(prec: Precedence)(op: => Text): Text =
if (prec < this.prec) atPrec(prec) ("(" ~ op ~ ")") else atPrec(prec)(op)

/** The name, possibley with with namespace suffix if debugNames is set:
/** The name, possibly with with namespace suffix if debugNames is set:
* /L for local names, /V for other term names, /T for type names
*/
def nameString(name: Name): String
Expand Down
Expand Up @@ -24,7 +24,7 @@ object AugmentScala2Traits {
/** This phase augments Scala2 traits with implementation classes and with additional members
* needed for mixin composition.
* These symbols would have been added between Unpickling and Mixin in the Scala2 pipeline.
* Specifcally, it adds
* Specifically, it adds
*
* - an implementation class which defines a trait constructor and trait method implementations
* - trait setters for vals defined in traits
Expand Down
4 changes: 2 additions & 2 deletions compiler/src/dotty/tools/dotc/transform/CheckStatic.scala
Expand Up @@ -12,7 +12,7 @@ import reporting.diagnostic.messages.{MissingCompanionForStatic, StaticFieldsOnl

/** A transformer that check that requirements of Static fields\methods are implemented:
* 1. Only objects can have members annotated with `@static`
* 2. The fields annotated with `@static` should preceed any non-`@static` fields.
* 2. The fields annotated with `@static` should precede any non-`@static` fields.
* This ensures that we do not introduce surprises for users in initialization order.
* 3. If a member `foo` of an `object C` is annotated with `@static`,
* the companion class `C` is not allowed to define term members with name `foo`.
Expand All @@ -37,7 +37,7 @@ class CheckStatic extends MiniPhase {
}

if (defn.isInstanceOf[ValDef] && hadNonStaticField) {
ctx.error("@static fields should preceed non-static ones", defn.pos)
ctx.error("@static fields should precede non-static ones", defn.pos)
}

val companion = ctx.owner.companionClass
Expand Down
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/transform/Erasure.scala
Expand Up @@ -259,7 +259,7 @@ object Erasure {
cast(ref(defn.runtimeMethodRef(nme.toObjectArray)).appliedTo(tree), pt)

// When casting between two EVTs, we need to check which one underlies the other to determine
// wheter u2evt or evt2u should be used.
// whether u2evt or evt2u should be used.
case (tp1 @ ErasedValueType(tycon1, underlying1), tp2 @ ErasedValueType(tycon2, underlying2)) =>
if (tp1 <:< underlying2)
// Cast EVT(tycon1, underlying1) to EVT(tycon2, EVT(tycon1, underlying1))
Expand Down
Expand Up @@ -103,7 +103,7 @@ class FirstTransform extends MiniPhase with InfoTransformer { thisPhase =>
reorder(stats, Nil)
}

/** elimiate self in Template */
/** eliminate self in Template */
override def transformTemplate(impl: Template)(implicit ctx: Context): Tree = {
cpy.Template(impl)(self = EmptyValDef)
}
Expand Down
Expand Up @@ -169,7 +169,7 @@ class PatternMatcherOld extends MiniPhase with DenotTransformer {
trait OptimizedCodegen extends CodegenCore {
override def codegen: AbsCodegen = optimizedCodegen

// when we know we're targetting Option, do some inlining the optimizer won't do
// when we know we're targeting Option, do some inlining the optimizer won't do
// for example, `o.flatMap(f)` becomes `if (o == None) None else f(o.get)`, similarly for orElse and guard
// this is a special instance of the advanced inlining optimization that takes a method call on
// an object of a type that only has two concrete subclasses, and inlines both bodies, guarded by an if to distinguish the two cases
Expand Down Expand Up @@ -504,7 +504,7 @@ class PatternMatcherOld extends MiniPhase with DenotTransformer {
* case d => <body>
* }
*
* d inside <body> was to be substitued by x.
* d inside <body> was to be substituted by x.
*
* In dotty, SubstOnlyTreeMakers instead generate normal ValDef,
* and does not create a new substitution.
Expand Down
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/typer/Implicits.scala
Expand Up @@ -1025,7 +1025,7 @@ trait Implicits { self: Typer =>
* - otherwise, if a previous search was also successful, handle the ambiguity
* in `disambiguate`,
* - otherwise, continue the search with all candidates that are not strictly
* worse than the succesful candidate.
* worse than the successful candidate.
* If a trial failed:
* - if the query term is a `Not[T]` treat it as a success,
* - otherwise, if the failure is an ambiguity, try to heal it (see @healAmbiguous)
Expand Down
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/typer/Inliner.scala
Expand Up @@ -626,7 +626,7 @@ class Inliner(call: tpd.Tree, rhsToInline: tpd.Tree)(implicit ctx: Context) {

val gadtSyms = typer.gadtSyms(scrutType)

/** Try to match pattern `pat` against scrutinee reference `scrut`. If succesful add
/** Try to match pattern `pat` against scrutinee reference `scrut`. If successful add
* bindings for variables bound in this pattern to `bindingsBuf`.
*/
def reducePattern(bindingsBuf: mutable.ListBuffer[MemberDef], scrut: TermRef, pat: Tree): Boolean = {
Expand Down
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/typer/RefChecks.scala
Expand Up @@ -152,7 +152,7 @@ object RefChecks {
* 4. Check that every member with an `override` modifier
* overrides some other member.
* TODO check that classes are not overridden
* TODO This still needs to be cleaned up; the current version is a staright port of what was there
* TODO This still needs to be cleaned up; the current version is a straight port of what was there
* before, but it looks too complicated and method bodies are far too large.
*/
private def checkAllOverrides(clazz: Symbol)(implicit ctx: Context): Unit = {
Expand Down
4 changes: 2 additions & 2 deletions compiler/src/dotty/tools/dotc/typer/Typer.scala
Expand Up @@ -954,7 +954,7 @@ class Typer extends Namer
|position = ${tree.pos}, raw type = ${mt.toString}""") // !!! DEBUG. Eventually, convert to an error?
}
else if ((tree.tpt `eq` untpd.ImplicitEmptyTree) && mt.paramNames.isEmpty)
// Note implicitness of function in target type sicne there are no method parameters that indicate it.
// Note implicitness of function in target type since there are no method parameters that indicate it.
TypeTree(defn.FunctionOf(Nil, mt.resType, isImplicit = true, isErased = false))
else
EmptyTree
Expand Down Expand Up @@ -2329,7 +2329,7 @@ class Typer extends Namer
*
* val x: AnyRef = f
*
* That's intentional, we want to fail here, otherwise some unsuccesful implicit searches
* That's intentional, we want to fail here, otherwise some unsuccessful implicit searches
* would go undetected.
*
* Examples for these cases are found in run/implicitFuns.scala and neg/i2006.scala.
Expand Down
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/util/HashSet.scala
Expand Up @@ -133,7 +133,7 @@ class HashSet[T >: Null <: AnyRef](powerOfTwoInitialCapacity: Int, loadFactor: F

/** Privileged access: Add entry `x` at the last position where an unsuccsessful
* `findEntryByHash` or `nextEntryByhash` operation returned. Needs to immediately
* follow a `findEntryByhash` or `nextEntryByHash` operation that was unsucessful,
* follow a `findEntryByhash` or `nextEntryByHash` operation that was unsuccessful,
* i.e. that returned `null`.
*/
protected def addEntryAfterScan(x: T): T = addEntryAt(rover, x)
Expand Down
6 changes: 3 additions & 3 deletions compiler/test-resources/repl/errmsgs
Expand Up @@ -42,13 +42,13 @@ scala> abstract class C { type T; val x: T; val s: Unit = { type T = String; var
|required: T'
|
|where: T is a type in class C
| T' is a type in the initalizer of value s which is an alias of String
| T' is a type in the initializer of value s which is an alias of String
1 | abstract class C { type T; val x: T; val s: Unit = { type T = String; var y: T = x; locally { def f() = { type T = Int; val z: T = y }; f() } }; }
| ^
|found: T(y)
|required: T'
|
|where: T is a type in the initalizer of value s which is an alias of String
|where: T is a type in the initializer of value s which is an alias of String
| T' is a type in method f which is an alias of Int
scala> class Foo() { def bar: Int = 1 }; val foo = new Foo(); foo.barr
1 | class Foo() { def bar: Int = 1 }; val foo = new Foo(); foo.barr
Expand Down Expand Up @@ -79,4 +79,4 @@ scala> def foo1(x: => Int) = x _
scala> def foo2(x: => Int): () => Int = x _
1 | def foo2(x: => Int): () => Int = x _
| ^^^
|Only function types can be followed by _ but the current expression has type Int
|Only function types can be followed by _ but the current expression has type Int
2 changes: 1 addition & 1 deletion compiler/test/dotty/tools/vulpix/ParallelTesting.scala
Expand Up @@ -838,7 +838,7 @@ trait ParallelTesting extends RunnerOrchestration { self =>
* neg tests
* =========
* Neg tests are expected to generate a certain amount of errors - but not
* crash the compiler. In each `.scala` file, you specifiy the line on which
* crash the compiler. In each `.scala` file, you specify the line on which
* the error will be generated, e.g:
*
* ```
Expand Down
2 changes: 1 addition & 1 deletion compiler/test/dotty/tools/vulpix/TestGroup.scala
@@ -1,6 +1,6 @@
package dotty.tools.vulpix

/** Test groups are used to ensure that the ouput of tests do not overlap.
/** Test groups are used to ensure that the output of tests do not overlap.
*
* It can be used to disambiguate ouputs of tests that test the same file but with different options as shown in the following example.
* compileFilesInDir("tests/pos", defaultOptions)(TestGroup("compileStdLib")) // will output in ./out/compileStdLib/...
Expand Down
2 changes: 1 addition & 1 deletion compiler/test/dotty/tools/vulpix/VulpixMetaTests.scala
Expand Up @@ -9,7 +9,7 @@ import TestConfiguration._

/** Meta tests for the Vulpix test suite. This test follows the structure of
* CompilationTests.scala. It is meant to be called from bash to diff with
* output againts an expected result.
* output against an expected result.
*/
@Category(Array(classOf[dotty.VulpixMetaTests]))
class VulpixMetaTests extends ParallelTesting {
Expand Down
2 changes: 1 addition & 1 deletion doc-tool/src/dotty/tools/dottydoc/util/MemberLookup.scala
Expand Up @@ -16,7 +16,7 @@ import model._
trait MemberLookup {
/** Performs a lookup based on the provided (pruned) query string
*
* Will return a `Tooltip` if unsucessfull, otherwise a LinkToEntity or
* Will return a `Tooltip` if unsucessful, otherwise a LinkToEntity or
* LinkToExternal
*/
def lookup(entity: Entity, packages: Map[String, Package], query: String): Option[Entity] = {
Expand Down
4 changes: 2 additions & 2 deletions docs/docs/internals/dotty-internals-1-notes.md
Expand Up @@ -47,8 +47,8 @@ Typed trees contain not only the user-written code, but also semantic informatio
* `Literal`: constants (e.g. integer constant 1)
* `Typed`: type ascription (e.g. for widening, as in `(1: Any)`)
* `NamedArg`: named arguments (can appear out-of-order in untyped trees, but will appear in-order in typed ones)
* `Assign`: assignment. The node has a `lhs` and a `rhs`, but the `lhs` can be arbitrarly complicated (e.g. `(new C).f = 0`).
* `If`: the condition in an if-expression can be arbitrarly complex (e.g. it can contain class definitions)
* `Assign`: assignment. The node has a `lhs` and a `rhs`, but the `lhs` can be arbitrarily complicated (e.g. `(new C).f = 0`).
* `If`: the condition in an if-expression can be arbitrarily complex (e.g. it can contain class definitions)
* `Closure`: the free variables are stored in the `env` field, but are only accessible "around" the `LambdaLift` phase.
* `Match` and `CaseDef`: pattern-matching trees. The `pat` field in `CaseDef` (the pattern) is, in turn, populated with a subset of trees like `Bind` and `Unapply`.
* `Return`: return from a method. If the `from` field is empty, then we return from the closest enclosing method.
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/reference/changed/eta-expansion.md
Expand Up @@ -28,7 +28,7 @@ Automatic eta expansion does not apply to "nullary" methods that take an empty p
def next(): T

, a simple reference to `next` does not auto-convert to a
function. One has to write explicitely `() => next()` to achieve that
function. One has to write explicitly `() => next()` to achieve that
(it's better to write it this way rather than `next _` because the latter
will be deprecated).

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/reference/enums/desugarEnums.md
Expand Up @@ -181,4 +181,4 @@ this object or its members via `this` or a simple identifier is also illegal. Th

A normal case class which is not produced from an enum case is not allowed to extend
`scala.Enum`. This ensures that the only cases of an enum are the ones that are
explictly declared in it.
explicitly declared in it.
8 changes: 4 additions & 4 deletions docs/docs/reference/erased-terms.md
Expand Up @@ -34,7 +34,7 @@ m.turnedOn.turnedOn // ERROR

Note that in the code above the actual implicit arguments for `IsOff` are never used at runtime; they serve only to establish the right constraints at compile time.
As these terms are never used at runtime there is not real need to have them around, but they still need to be
present in some form in the generated code to be able to do separate compilation and retain binary compatiblity.
present in some form in the generated code to be able to do separate compilation and retain binary compatibility.

How to define erased terms?
-------------------------------
Expand Down Expand Up @@ -186,8 +186,8 @@ Rules


5. Erasure Semantics
* All `erased` paramters are removed from the function
* All argument to `erased` paramters are not passed to the function
* All `erased` parameters are removed from the function
* All argument to `erased` parameters are not passed to the function
* All `erased` definitions are removed
* All `(erased T1, T2, ..., TN) => R` and `(implicit erased T1, T2, ..., TN) => R` become `() => R`

Expand All @@ -199,5 +199,5 @@ Rules

7. Overriding
* Member definitions overidding each other must both be `erased` or not be `erased`
* `def foo(x: T): U` cannot be overriden by `def foo(erased x: T): U` an viceversa
* `def foo(x: T): U` cannot be overridden by `def foo(erased x: T): U` an viceversa

0 comments on commit fd2b180

Please sign in to comment.