Skip to content

Commit 773f354

Browse files
committed
fix some typo
1 parent 5374d91 commit 773f354

23 files changed

+38
-38
lines changed

compiler/src/dotty/tools/backend/jvm/BCodeBodyBuilder.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ trait BCodeBodyBuilder extends BCodeSkelBuilder {
324324
if (!fun.symbol.isStaticMember) {
325325
// load receiver of non-static implementation of lambda
326326

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

@@ -1035,7 +1035,7 @@ trait BCodeBodyBuilder extends BCodeSkelBuilder {
10351035
(args zip params) filterNot isTrivial
10361036
}
10371037

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

10411041
// second assign one by one to the LabelDef's variables.

compiler/src/dotty/tools/backend/jvm/BTypes.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,7 @@ abstract class BTypes {
445445
* local and anonymous classes, no matter if there is an enclosing method or not. Accordingly, the
446446
* "class" field (see below) must be always defined, while the "method" field may be null.
447447
*
448-
* NOTE: When a EnclosingMethod attribute is requried (local and anonymous classes), the "outer"
448+
* NOTE: When a EnclosingMethod attribute is required (local and anonymous classes), the "outer"
449449
* field in the InnerClass table must be null.
450450
*
451451
* Fields:

compiler/src/dotty/tools/backend/jvm/BTypesFromSymbols.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import scala.annotation.threadUnsafe
77

88
/**
99
* This class mainly contains the method classBTypeFromSymbol, which extracts the necessary
10-
* information from a symbol and its type to create the correpsonding ClassBType. It requires
10+
* information from a symbol and its type to create the corresponding ClassBType. It requires
1111
* access to the compiler (global parameter).
1212
*
1313
* The mixin CoreBTypes defines core BTypes that are used in the backend. Building these BTypes

compiler/src/dotty/tools/backend/jvm/BackendInterface.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -626,7 +626,7 @@ abstract class BackendInterface extends BackendInterfaceDefinitions {
626626
}
627627

628628
abstract class Primitives {
629-
def getPrimitive(app: Apply, reciever: Type): Int
629+
def getPrimitive(app: Apply, receiver: Type): Int
630630
def isPrimitive(fun: Tree): Boolean
631631
def getPrimitive(sym: Symbol): Int
632632
}
@@ -722,7 +722,7 @@ abstract class BackendInterfaceDefinitions { self: BackendInterface =>
722722
val DoubleClass: Symbol
723723

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

727727
lazy val NativeAttr: Symbol = requiredClass[scala.native]
728728
lazy val TransientAttr = requiredClass[scala.transient]

compiler/src/dotty/tools/backend/jvm/BytecodeWriters.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ trait BytecodeWriters {
6767
}
6868

6969
/*
70-
* The ASM textual representation for bytecode overcomes disadvantages of javap ouput in three areas:
70+
* The ASM textual representation for bytecode overcomes disadvantages of javap output in three areas:
7171
* (a) pickle dingbats undecipherable to the naked eye;
7272
* (b) two constant pools, while having identical contents, are displayed differently due to physical layout.
7373
* (c) stack maps (classfile version 50 and up) are displayed in encoded form by javap,

compiler/src/dotty/tools/dotc/ast/Desugar.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -859,7 +859,7 @@ object desugar {
859859
* given object name extends parents { self => body' }
860860
*
861861
* where every definition in `body` is expanded to an extension method
862-
* taking type parameters `tparams` and a leading paramter `(x: T)`.
862+
* taking type parameters `tparams` and a leading parameter `(x: T)`.
863863
* See: makeExtensionDef
864864
*/
865865
def moduleDef(mdef: ModuleDef)(implicit ctx: Context): Tree = {

compiler/src/dotty/tools/dotc/core/JavaNullInterop.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ object JavaNullInterop {
118118
case tp: TypeRef if needsNull(tp) => OrUncheckedNull(tp)
119119
case appTp @ AppliedType(tycon, targs) =>
120120
val oldOutermostNullable = outermostLevelAlreadyNullable
121-
// We don't make the outmost levels of type arguements nullable if tycon is Java-defined.
121+
// We don't make the outmost levels of type arguments nullable if tycon is Java-defined.
122122
// This is because Java classes are _all_ nullified, so both `java.util.List[String]` and
123123
// `java.util.List[String|Null]` contain nullable elements.
124124
outermostLevelAlreadyNullable = tp.classSymbol.is(JavaDefined)

compiler/src/dotty/tools/dotc/reporting/diagnostic/messages.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ object messages {
3737
) extends MessageContainer(msgFn, pos, ERROR)
3838

3939
/** A sticky error is an error that should not be hidden by backtracking and
40-
* trying some alternative path. Typcially, errors issued after catching
40+
* trying some alternative path. Typically, errors issued after catching
4141
* a TypeError exception are sticky.
4242
*/
4343
class StickyError(

compiler/src/dotty/tools/dotc/typer/Applications.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -916,7 +916,7 @@ trait Applications extends Compatibility {
916916
case CaseDef(Bind(_, Typed(_: Ident, _)), _, _) => // OK
917917
case CaseDef(Ident(name), _, _) if name == nme.WILDCARD => // Ok
918918
case CaseDef(pat, _, _) =>
919-
ctx.error("Unexpected pattern for summonFrom. Expeced `x: T` or `_`", pat.sourcePos)
919+
ctx.error("Unexpected pattern for summonFrom. Expected `x: T` or `_`", pat.sourcePos)
920920
}
921921
typed(untpd.InlineMatch(EmptyTree, cases).withSpan(arg.span), pt)
922922
case _ =>

compiler/src/dotty/tools/dotc/typer/Deriving.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ trait Deriving {
6363
* (1) It must be a class type with a stable prefix (@see checkClassTypeWithStablePrefix)
6464
*
6565
* (2) It must belong to one of the following three categories:
66-
* (a) a single paramter type class with a parameter which matches the kind of
66+
* (a) a single parameter type class with a parameter which matches the kind of
6767
* the deriving ADT
6868
* (b) a single parameter type class with a parameter of kind * and an ADT with
6969
* one or more type parameter of kind *

compiler/src/dotty/tools/dotc/typer/Nullables.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ object Nullables:
238238
&& s != refOwner
239239
&& (s.isOneOf(Lazy | Method) // not at the rhs of lazy ValDef or in a method (or lambda)
240240
|| s.isClass // not in a class
241-
// TODO: need to check by-name paramter
241+
// TODO: need to check by-name parameter
242242
|| recur(s.owner))
243243

244244
refSym.is(Mutable) // if it is immutable, we don't need to check the rest conditions

compiler/src/dotty/tools/dotc/typer/QuotesAndSplices.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ trait QuotesAndSplices {
305305
* case '{ type ${given t: Type[$t @ _]}; ${ls: Expr[List[$t]]} } => ...
306306
* ```
307307
*
308-
* Then the pattern is _split_ into the expression containd in the pattern replacing the splices by holes,
308+
* Then the pattern is _split_ into the expression contained in the pattern replacing the splices by holes,
309309
* and the patterns in the splices. All these are recombined into a call to `Matcher.unapply`.
310310
*
311311
* ```
@@ -315,7 +315,7 @@ trait QuotesAndSplices {
315315
* ](
316316
* Tuple2.unapply
317317
* [Type[$t], Expr[List[$t]]] //Propagated from the tuple above
318-
* (implict t @ _, ls @ _: Expr[List[$t]]) // from the spliced patterns
318+
* (implicit t @ _, ls @ _: Expr[List[$t]]) // from the spliced patterns
319319
* )(
320320
* '{ // Runtime quote Matcher.unapply uses to mach against. Expression directly inside the quoted pattern without the splices
321321
* @scala.internal.Quoted.patternBindHole type $t

library/src/scala/Tuple.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ object Tuple {
173173
val xs2: IArray[Object] = xs match {
174174
case xs: IArray[Object] => xs
175175
case xs =>
176-
// TODO suport IArray.map
176+
// TODO support IArray.map
177177
xs.asInstanceOf[Array[T]].map(_.asInstanceOf[Object]).asInstanceOf[IArray[Object]]
178178
}
179179
DynamicTuple.dynamicFromIArray[Tuple](xs2)

library/src/scala/internal/quoted/Matcher.scala

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ private[quoted] object Matcher {
2121
* ```
2222
* '{val a = 4; a * a} match case '{ val x = 4; x * x }
2323
* ```
24-
* when matching `a * a` with `x * x` the enviroment will contain `Map(a -> x)`.
24+
* when matching `a * a` with `x * x` the environment will contain `Map(a -> x)`.
2525
*/
2626
private type Env = Map[Symbol, Symbol]
2727

@@ -35,10 +35,10 @@ private[quoted] object Matcher {
3535
val ctx: Context = internal.Context_GADT_setFreshGADTBounds(rootContext)
3636
given Context = ctx
3737
val matchings = scrutineeTerm.underlyingArgument =?= patternTerm.underlyingArgument
38-
// After matching and doing all subtype checks, we have to aproximate all the type bindings
38+
// After matching and doing all subtype checks, we have to approximate all the type bindings
3939
// that we have found and seal them in a quoted.Type
4040
matchings.asOptionOfTuple.map { tup =>
41-
Tuple.fromArray(tup.toArray.map { // TODO improve performace
41+
Tuple.fromArray(tup.toArray.map { // TODO improve performance
4242
case x: SymBinding => internal.Context_GADT_approximation(summon[Context])(x.sym, !x.fromAbove).seal
4343
case x => x
4444
})
@@ -56,10 +56,10 @@ private[quoted] object Matcher {
5656
val ctx: Context = internal.Context_GADT_setFreshGADTBounds(rootContext)
5757
given Context = ctx
5858
val matchings = scrutineeTypeTree =?= patternTypeTree
59-
// After matching and doing all subtype checks, we have to aproximate all the type bindings
59+
// After matching and doing all subtype checks, we have to approximate all the type bindings
6060
// that we have found and seal them in a quoted.Type
6161
matchings.asOptionOfTuple.map { tup =>
62-
Tuple.fromArray(tup.toArray.map { // TODO improve performace
62+
Tuple.fromArray(tup.toArray.map { // TODO improve performance
6363
case x: SymBinding => internal.Context_GADT_approximation(summon[Context])(x.sym, !x.fromAbove).seal
6464
case x => x
6565
})
@@ -437,7 +437,7 @@ private[quoted] object Matcher {
437437

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

440-
/** Concatenates the contents of two sucessful matchings or return a `notMatched` */
440+
/** Concatenates the contents of two successful matchings or return a `notMatched` */
441441
def (self: Matching) && (that: => Matching): Matching = self match {
442442
case Some(x) =>
443443
that match {

library/src/scala/internal/quoted/showName.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ package scala.internal.quoted
1515
* ```scala
1616
* let("myVal")('{4})(x => '{ $x + 1}).show
1717
* ```
18-
* will retuns the code
18+
* will returns the code
1919
* ```scala
2020
* val myVal = 4
2121
* myVal + 1

library/src/scala/tasty/Reflection.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ class Reflection(private[scala] val internal: CompilerInterface) { self =>
139139
/** Tree representing a class definition. This includes annonymus class definitions and the class of a module object */
140140
type ClassDef = internal.ClassDef
141141

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

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

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

501501
/** Shows the tree as extractors */

library/src/scala/tasty/reflect/CompilerInterface.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ trait CompilerInterface {
267267

268268
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
269269

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

273273
def isInstanceOfTypeDef(using ctx: Context): IsInstanceOf[TypeDef]

tests/explicit-nulls/neg/var-ref-in-closure.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Test that we don't track variables which is refered in another closure.
1+
// Test that we don't track variables which is referred in another closure.
22

33
object VarRef {
44
locally {

tests/explicit-nulls/pos/override-java-object-arg.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// When we load a Java class file, if a java method has an argument with type
33
// 'Object', it (the method argument) gets loaded by Dotty as 'Any' (as opposed to 'AnyRef').
44
// This is pre-explicit-nulls behaviour.
5-
// There is special logic in the type comparer that allows that method to be overriden
5+
// There is special logic in the type comparer that allows that method to be overridden
66
// with a corresponding argument with type 'AnyRef'.
77
// This test verifies that we can continue to override such methods, except that in
88
// the explicit nulls world we override with 'AnyRef|Null'.

tests/init/neg/override8.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ trait Yun {
2727
class Tao {
2828
private val m = "hello"
2929

30-
private def msg = "can be overriden"
30+
private def msg = "can be overridden"
3131

3232
def foo(n: Int) = m + msg
3333
}

tests/run-deep-subtype/Tuple-apply.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ object Test {
1818
assert(3 == (1, 2, 3, 4, 5).apply(2))
1919
assert(4 == (1, 2, 3, 4, 5).apply(3))
2020
assert(5 == (1, 2, 3, 4, 5).apply(4))
21-
// TODO improve performace
21+
// TODO improve performance
2222
// assert(1 == (1, 2, 3, 4, 5, 6).apply(0))
2323
// assert(2 == (1, 2, 3, 4, 5, 6).apply(1))
2424
// assert(3 == (1, 2, 3, 4, 5, 6).apply(2))
@@ -119,7 +119,7 @@ object Test {
119119
assert(1 == (1 *: 2 *: 3 *: 4 *: 5 *: ()).apply(0))
120120
assert(1 == (1 *: 2 *: 3 *: 4 *: 5 *: 6 *: ()).apply(0))
121121
assert(1 == (1 *: 2 *: 3 *: 4 *: 5 *: 6 *: 7 *: ()).apply(0))
122-
// FIXME performace
122+
// FIXME performance
123123
// assert(1 == (1 *: 2 *: 3 *: 4 *: 5 *: 6 *: 7 *: 8 *: ()).apply(0))
124124
// assert(1 == (1 *: 2 *: 3 *: 4 *: 5 *: 6 *: 7 *: 8 *: 9 *: ()).apply(0))
125125
// assert(1 == (1 *: 2 *: 3 *: 4 *: 5 *: 6 *: 7 *: 8 *: 9 *: 10 *: ()).apply(0))
@@ -146,7 +146,7 @@ object Test {
146146
assert(5 == (1 *: 2 *: 3 *: 4 *: 5 *: ()).apply(4))
147147
assert(6 == (1 *: 2 *: 3 *: 4 *: 5 *: 6 *: ()).apply(5))
148148
assert(7 == (1 *: 2 *: 3 *: 4 *: 5 *: 6 *: 7 *: ()).apply(6))
149-
// FIXME performace
149+
// FIXME performance
150150
// assert(8 == (1 *: 2 *: 3 *: 4 *: 5 *: 6 *: 7 *: 8 *: ()).apply(7))
151151
// assert(9 == (1 *: 2 *: 3 *: 4 *: 5 *: 6 *: 7 *: 8 *: 9 *: ()).apply(8))
152152
// assert(10 == (1 *: 2 *: 3 *: 4 *: 5 *: 6 *: 7 *: 8 *: 9 *: 10 *: ()).apply(9))

tests/run/quoted-sematics-1.check

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Input: Nat(1)
22
Type: NatType
33
Result: Nat(1)
44

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

88
Input: Box(Nat(2))
@@ -73,9 +73,9 @@ Step: Box(Splice(Box(Nat(4))))
7373
Step: Box(Nat(4))
7474
Result: Box(Nat(4))
7575

76-
Failed to type Lambda(`x0`,NatType,Ref(`x0`)) at level 1 with enviroment Set(EnvVar(`x0`,1,NatType))
77-
Failed to type Lambda(`x0`,NatType,Lambda(`x0`,NatType,Ref(`x0`))) at level 1 with enviroment Set()
78-
Failed to type Box(Lambda(`x0`,NatType,Lambda(`x0`,NatType,Ref(`x0`)))) at level 0 with enviroment Set()
76+
Failed to type Lambda(`x0`,NatType,Ref(`x0`)) at level 1 with environment Set(EnvVar(`x0`,1,NatType))
77+
Failed to type Lambda(`x0`,NatType,Lambda(`x0`,NatType,Ref(`x0`))) at level 1 with environment Set()
78+
Failed to type Box(Lambda(`x0`,NatType,Lambda(`x0`,NatType,Ref(`x0`)))) at level 0 with environment Set()
7979
Failed to typechecks: Box(Lambda(`x0`,NatType,Lambda(`x0`,NatType,Ref(`x0`))))
8080

8181
Input: Fix(Lambda(`x0`,NatType,Nat(1)))

tests/run/quoted-sematics-1.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ def typeChecks(g: Gamma)(level: 0 | 1)(term: Term): Option[Type] =
101101
for LambdaType(t1, t2) <- typeChecks(g)(0)(t) yield t2 // T-Fix
102102
case _ => None
103103
if res.isEmpty then
104-
println(s"Failed to type $term at level $level with enviroment $g")
104+
println(s"Failed to type $term at level $level with environment $g")
105105
res
106106

107107

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

178178

179179
def subst(body: Term, name: Name, term: Term): Term =
180-
val substitutedTerm = refresh(term) // Could also be done within the substitution to ensure globaly unique names
180+
val substitutedTerm = refresh(term) // Could also be done within the substitution to ensure globally unique names
181181
// def substitutedTerm = refresh(term) // Alternative with globally unique names
182182
def subst(body: Term): Term =
183183
body match

0 commit comments

Comments
 (0)