Skip to content

fix some typo #8323

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions compiler/src/dotty/tools/backend/jvm/BCodeBodyBuilder.scala
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ trait BCodeBodyBuilder extends BCodeSkelBuilder {
if (!fun.symbol.isStaticMember) {
// load receiver of non-static implementation of lambda

// darkdimius: I haven't found in spec `this` refference should go
// darkdimius: I haven't found in spec `this` reference should go
// but I was able to derrive it by reading
// AbstractValidatingLambdaMetafactory.validateMetafactoryArgs

Expand Down Expand Up @@ -1035,7 +1035,7 @@ trait BCodeBodyBuilder extends BCodeSkelBuilder {
(args zip params) filterNot isTrivial
}

// first push *all* arguments. This makes sure muliple uses of the same labelDef-var will all denote the (previous) value.
// first push *all* arguments. This makes sure multiple uses of the same labelDef-var will all denote the (previous) value.
aps foreach { case (arg, param) => genLoad(arg, locals(param).tk) } // `locals` is known to contain `param` because `genDefDef()` visited `labelDefsAtOrUnder`

// second assign one by one to the LabelDef's variables.
Expand Down
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/backend/jvm/BTypes.scala
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ abstract class BTypes {
* local and anonymous classes, no matter if there is an enclosing method or not. Accordingly, the
* "class" field (see below) must be always defined, while the "method" field may be null.
*
* NOTE: When a EnclosingMethod attribute is requried (local and anonymous classes), the "outer"
* NOTE: When a EnclosingMethod attribute is required (local and anonymous classes), the "outer"
* field in the InnerClass table must be null.
*
* Fields:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import scala.annotation.threadUnsafe

/**
* This class mainly contains the method classBTypeFromSymbol, which extracts the necessary
* information from a symbol and its type to create the correpsonding ClassBType. It requires
* information from a symbol and its type to create the corresponding ClassBType. It requires
* access to the compiler (global parameter).
*
* The mixin CoreBTypes defines core BTypes that are used in the backend. Building these BTypes
Expand Down
4 changes: 2 additions & 2 deletions compiler/src/dotty/tools/backend/jvm/BackendInterface.scala
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,7 @@ abstract class BackendInterface extends BackendInterfaceDefinitions {
}

abstract class Primitives {
def getPrimitive(app: Apply, reciever: Type): Int
def getPrimitive(app: Apply, receiver: Type): Int
def isPrimitive(fun: Tree): Boolean
def getPrimitive(sym: Symbol): Int
}
Expand Down Expand Up @@ -722,7 +722,7 @@ abstract class BackendInterfaceDefinitions { self: BackendInterface =>
val DoubleClass: Symbol

// Class symbols used in backend.
// Vals becouse they are to frequent in scala programs so that they are already loaded by backend
// Vals because they are to frequent in scala programs so that they are already loaded by backend

lazy val NativeAttr: Symbol = requiredClass[scala.native]
lazy val TransientAttr = requiredClass[scala.transient]
Expand Down
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/backend/jvm/BytecodeWriters.scala
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ trait BytecodeWriters {
}

/*
* The ASM textual representation for bytecode overcomes disadvantages of javap ouput in three areas:
* The ASM textual representation for bytecode overcomes disadvantages of javap output in three areas:
* (a) pickle dingbats undecipherable to the naked eye;
* (b) two constant pools, while having identical contents, are displayed differently due to physical layout.
* (c) stack maps (classfile version 50 and up) are displayed in encoded form by javap,
Expand Down
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/ast/Desugar.scala
Original file line number Diff line number Diff line change
Expand Up @@ -859,7 +859,7 @@ object desugar {
* given object name extends parents { self => body' }
*
* where every definition in `body` is expanded to an extension method
* taking type parameters `tparams` and a leading paramter `(x: T)`.
* taking type parameters `tparams` and a leading parameter `(x: T)`.
* See: makeExtensionDef
*/
def moduleDef(mdef: ModuleDef)(implicit ctx: Context): Tree = {
Expand Down
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/core/JavaNullInterop.scala
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ object JavaNullInterop {
case tp: TypeRef if needsNull(tp) => OrUncheckedNull(tp)
case appTp @ AppliedType(tycon, targs) =>
val oldOutermostNullable = outermostLevelAlreadyNullable
// We don't make the outmost levels of type arguements nullable if tycon is Java-defined.
// We don't make the outmost levels of type arguments nullable if tycon is Java-defined.
// This is because Java classes are _all_ nullified, so both `java.util.List[String]` and
// `java.util.List[String|Null]` contain nullable elements.
outermostLevelAlreadyNullable = tp.classSymbol.is(JavaDefined)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ object messages {
) extends MessageContainer(msgFn, pos, ERROR)

/** A sticky error is an error that should not be hidden by backtracking and
* trying some alternative path. Typcially, errors issued after catching
* trying some alternative path. Typically, errors issued after catching
* a TypeError exception are sticky.
*/
class StickyError(
Expand Down
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/typer/Applications.scala
Original file line number Diff line number Diff line change
Expand Up @@ -916,7 +916,7 @@ trait Applications extends Compatibility {
case CaseDef(Bind(_, Typed(_: Ident, _)), _, _) => // OK
case CaseDef(Ident(name), _, _) if name == nme.WILDCARD => // Ok
case CaseDef(pat, _, _) =>
ctx.error("Unexpected pattern for summonFrom. Expeced `x: T` or `_`", pat.sourcePos)
ctx.error("Unexpected pattern for summonFrom. Expected `x: T` or `_`", pat.sourcePos)
}
typed(untpd.InlineMatch(EmptyTree, cases).withSpan(arg.span), pt)
case _ =>
Expand Down
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/typer/Deriving.scala
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ trait Deriving {
* (1) It must be a class type with a stable prefix (@see checkClassTypeWithStablePrefix)
*
* (2) It must belong to one of the following three categories:
* (a) a single paramter type class with a parameter which matches the kind of
* (a) a single parameter type class with a parameter which matches the kind of
* the deriving ADT
* (b) a single parameter type class with a parameter of kind * and an ADT with
* one or more type parameter of kind *
Expand Down
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/typer/Nullables.scala
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ object Nullables:
&& s != refOwner
&& (s.isOneOf(Lazy | Method) // not at the rhs of lazy ValDef or in a method (or lambda)
|| s.isClass // not in a class
// TODO: need to check by-name paramter
// TODO: need to check by-name parameter
|| recur(s.owner))

refSym.is(Mutable) // if it is immutable, we don't need to check the rest conditions
Expand Down
4 changes: 2 additions & 2 deletions compiler/src/dotty/tools/dotc/typer/QuotesAndSplices.scala
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ trait QuotesAndSplices {
* case '{ type ${given t: Type[$t @ _]}; ${ls: Expr[List[$t]]} } => ...
* ```
*
* Then the pattern is _split_ into the expression containd in the pattern replacing the splices by holes,
* Then the pattern is _split_ into the expression contained in the pattern replacing the splices by holes,
* and the patterns in the splices. All these are recombined into a call to `Matcher.unapply`.
*
* ```
Expand All @@ -315,7 +315,7 @@ trait QuotesAndSplices {
* ](
* Tuple2.unapply
* [Type[$t], Expr[List[$t]]] //Propagated from the tuple above
* (implict t @ _, ls @ _: Expr[List[$t]]) // from the spliced patterns
* (implicit t @ _, ls @ _: Expr[List[$t]]) // from the spliced patterns
* )(
* '{ // Runtime quote Matcher.unapply uses to mach against. Expression directly inside the quoted pattern without the splices
* @scala.internal.Quoted.patternBindHole type $t
Expand Down
2 changes: 1 addition & 1 deletion library/src/scala/Tuple.scala
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ object Tuple {
val xs2: IArray[Object] = xs match {
case xs: IArray[Object] => xs
case xs =>
// TODO suport IArray.map
// TODO support IArray.map
xs.asInstanceOf[Array[T]].map(_.asInstanceOf[Object]).asInstanceOf[IArray[Object]]
}
DynamicTuple.dynamicFromIArray[Tuple](xs2)
Expand Down
12 changes: 6 additions & 6 deletions library/src/scala/internal/quoted/Matcher.scala
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ private[quoted] object Matcher {
* ```
* '{val a = 4; a * a} match case '{ val x = 4; x * x }
* ```
* when matching `a * a` with `x * x` the enviroment will contain `Map(a -> x)`.
* when matching `a * a` with `x * x` the environment will contain `Map(a -> x)`.
*/
private type Env = Map[Symbol, Symbol]

Expand All @@ -35,10 +35,10 @@ private[quoted] object Matcher {
val ctx: Context = internal.Context_GADT_setFreshGADTBounds(rootContext)
given Context = ctx
val matchings = scrutineeTerm.underlyingArgument =?= patternTerm.underlyingArgument
// After matching and doing all subtype checks, we have to aproximate all the type bindings
// After matching and doing all subtype checks, we have to approximate all the type bindings
// that we have found and seal them in a quoted.Type
matchings.asOptionOfTuple.map { tup =>
Tuple.fromArray(tup.toArray.map { // TODO improve performace
Tuple.fromArray(tup.toArray.map { // TODO improve performance
case x: SymBinding => internal.Context_GADT_approximation(summon[Context])(x.sym, !x.fromAbove).seal
case x => x
})
Expand All @@ -56,10 +56,10 @@ private[quoted] object Matcher {
val ctx: Context = internal.Context_GADT_setFreshGADTBounds(rootContext)
given Context = ctx
val matchings = scrutineeTypeTree =?= patternTypeTree
// After matching and doing all subtype checks, we have to aproximate all the type bindings
// After matching and doing all subtype checks, we have to approximate all the type bindings
// that we have found and seal them in a quoted.Type
matchings.asOptionOfTuple.map { tup =>
Tuple.fromArray(tup.toArray.map { // TODO improve performace
Tuple.fromArray(tup.toArray.map { // TODO improve performance
case x: SymBinding => internal.Context_GADT_approximation(summon[Context])(x.sym, !x.fromAbove).seal
case x => x
})
Expand Down Expand Up @@ -437,7 +437,7 @@ private[quoted] object Matcher {

def (self: Matching) asOptionOfTuple: Option[Tuple] = self

/** Concatenates the contents of two sucessful matchings or return a `notMatched` */
/** Concatenates the contents of two successful matchings or return a `notMatched` */
def (self: Matching) && (that: => Matching): Matching = self match {
case Some(x) =>
that match {
Expand Down
2 changes: 1 addition & 1 deletion library/src/scala/internal/quoted/showName.scala
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ package scala.internal.quoted
* ```scala
* let("myVal")('{4})(x => '{ $x + 1}).show
* ```
* will retuns the code
* will returns the code
* ```scala
* val myVal = 4
* myVal + 1
Expand Down
4 changes: 2 additions & 2 deletions library/src/scala/tasty/Reflection.scala
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ class Reflection(private[scala] val internal: CompilerInterface) { self =>
/** Tree representing a class definition. This includes annonymus class definitions and the class of a module object */
type ClassDef = internal.ClassDef

/** Tree representing a type (paramter or member) definition in the source code */
/** Tree representing a type (parameter or member) definition in the source code */
type TypeDef = internal.TypeDef

/** Tree representing a method definition in the source code */
Expand Down Expand Up @@ -495,7 +495,7 @@ class Reflection(private[scala] val internal: CompilerInterface) { self =>
/** Position in the source code */
def pos(using ctx: Context): Position = internal.Tree_pos(tree)

/** Symbol of defined or refered by this tree */
/** Symbol of defined or referred by this tree */
def symbol(using ctx: Context): Symbol = internal.Tree_symbol(tree)

/** Shows the tree as extractors */
Expand Down
2 changes: 1 addition & 1 deletion library/src/scala/tasty/reflect/CompilerInterface.scala
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ trait CompilerInterface {

def ClassDef_copy(original: Tree)(name: String, constr: DefDef, parents: List[Tree/* Term | TypeTree */], derived: List[TypeTree], selfOpt: Option[ValDef], body: List[Statement])(using ctx: Context): ClassDef

/** Tree representing a type (paramter or member) definition in the source code */
/** Tree representing a type (parameter or member) definition in the source code */
type TypeDef <: Definition

def isInstanceOfTypeDef(using ctx: Context): IsInstanceOf[TypeDef]
Expand Down
2 changes: 1 addition & 1 deletion tests/explicit-nulls/neg/var-ref-in-closure.scala
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Test that we don't track variables which is refered in another closure.
// Test that we don't track variables which is referred in another closure.

object VarRef {
locally {
Expand Down
2 changes: 1 addition & 1 deletion tests/explicit-nulls/pos/override-java-object-arg.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// When we load a Java class file, if a java method has an argument with type
// 'Object', it (the method argument) gets loaded by Dotty as 'Any' (as opposed to 'AnyRef').
// This is pre-explicit-nulls behaviour.
// There is special logic in the type comparer that allows that method to be overriden
// There is special logic in the type comparer that allows that method to be overridden
// with a corresponding argument with type 'AnyRef'.
// This test verifies that we can continue to override such methods, except that in
// the explicit nulls world we override with 'AnyRef|Null'.
Expand Down
2 changes: 1 addition & 1 deletion tests/init/neg/override8.scala
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ trait Yun {
class Tao {
private val m = "hello"

private def msg = "can be overriden"
private def msg = "can be overridden"

def foo(n: Int) = m + msg
}
Expand Down
6 changes: 3 additions & 3 deletions tests/run-deep-subtype/Tuple-apply.scala
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ object Test {
assert(3 == (1, 2, 3, 4, 5).apply(2))
assert(4 == (1, 2, 3, 4, 5).apply(3))
assert(5 == (1, 2, 3, 4, 5).apply(4))
// TODO improve performace
// TODO improve performance
// assert(1 == (1, 2, 3, 4, 5, 6).apply(0))
// assert(2 == (1, 2, 3, 4, 5, 6).apply(1))
// assert(3 == (1, 2, 3, 4, 5, 6).apply(2))
Expand Down Expand Up @@ -119,7 +119,7 @@ object Test {
assert(1 == (1 *: 2 *: 3 *: 4 *: 5 *: ()).apply(0))
assert(1 == (1 *: 2 *: 3 *: 4 *: 5 *: 6 *: ()).apply(0))
assert(1 == (1 *: 2 *: 3 *: 4 *: 5 *: 6 *: 7 *: ()).apply(0))
// FIXME performace
// FIXME performance
// assert(1 == (1 *: 2 *: 3 *: 4 *: 5 *: 6 *: 7 *: 8 *: ()).apply(0))
// assert(1 == (1 *: 2 *: 3 *: 4 *: 5 *: 6 *: 7 *: 8 *: 9 *: ()).apply(0))
// assert(1 == (1 *: 2 *: 3 *: 4 *: 5 *: 6 *: 7 *: 8 *: 9 *: 10 *: ()).apply(0))
Expand All @@ -146,7 +146,7 @@ object Test {
assert(5 == (1 *: 2 *: 3 *: 4 *: 5 *: ()).apply(4))
assert(6 == (1 *: 2 *: 3 *: 4 *: 5 *: 6 *: ()).apply(5))
assert(7 == (1 *: 2 *: 3 *: 4 *: 5 *: 6 *: 7 *: ()).apply(6))
// FIXME performace
// FIXME performance
// assert(8 == (1 *: 2 *: 3 *: 4 *: 5 *: 6 *: 7 *: 8 *: ()).apply(7))
// assert(9 == (1 *: 2 *: 3 *: 4 *: 5 *: 6 *: 7 *: 8 *: 9 *: ()).apply(8))
// assert(10 == (1 *: 2 *: 3 *: 4 *: 5 *: 6 *: 7 *: 8 *: 9 *: 10 *: ()).apply(9))
Expand Down
8 changes: 4 additions & 4 deletions tests/run/quoted-sematics-1.check
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Input: Nat(1)
Type: NatType
Result: Nat(1)

Failed to type Nat(-1) at level 0 with enviroment Set()
Failed to type Nat(-1) at level 0 with environment Set()
Failed to typechecks: Nat(-1)

Input: Box(Nat(2))
Expand Down Expand Up @@ -73,9 +73,9 @@ Step: Box(Splice(Box(Nat(4))))
Step: Box(Nat(4))
Result: Box(Nat(4))

Failed to type Lambda(`x0`,NatType,Ref(`x0`)) at level 1 with enviroment Set(EnvVar(`x0`,1,NatType))
Failed to type Lambda(`x0`,NatType,Lambda(`x0`,NatType,Ref(`x0`))) at level 1 with enviroment Set()
Failed to type Box(Lambda(`x0`,NatType,Lambda(`x0`,NatType,Ref(`x0`)))) at level 0 with enviroment Set()
Failed to type Lambda(`x0`,NatType,Ref(`x0`)) at level 1 with environment Set(EnvVar(`x0`,1,NatType))
Failed to type Lambda(`x0`,NatType,Lambda(`x0`,NatType,Ref(`x0`))) at level 1 with environment Set()
Failed to type Box(Lambda(`x0`,NatType,Lambda(`x0`,NatType,Ref(`x0`)))) at level 0 with environment Set()
Failed to typechecks: Box(Lambda(`x0`,NatType,Lambda(`x0`,NatType,Ref(`x0`))))

Input: Fix(Lambda(`x0`,NatType,Nat(1)))
Expand Down
4 changes: 2 additions & 2 deletions tests/run/quoted-sematics-1.scala
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def typeChecks(g: Gamma)(level: 0 | 1)(term: Term): Option[Type] =
for LambdaType(t1, t2) <- typeChecks(g)(0)(t) yield t2 // T-Fix
case _ => None
if res.isEmpty then
println(s"Failed to type $term at level $level with enviroment $g")
println(s"Failed to type $term at level $level with environment $g")
res


Expand Down Expand Up @@ -177,7 +177,7 @@ def matchPat(scrutinee: Term, pat: Pattern): Option[Term => Term] =


def subst(body: Term, name: Name, term: Term): Term =
val substitutedTerm = refresh(term) // Could also be done within the substitution to ensure globaly unique names
val substitutedTerm = refresh(term) // Could also be done within the substitution to ensure globally unique names
// def substitutedTerm = refresh(term) // Alternative with globally unique names
def subst(body: Term): Term =
body match
Expand Down