Skip to content

Commit e5ee36e

Browse files
Backport "fix typo" to LTS (#22088)
Backports #21324 to the 3.3.5. PR submitted by the release tooling. [skip ci]
2 parents 7f26c1a + dd1523f commit e5ee36e

36 files changed

+39
-39
lines changed

Diff for: compiler/src/dotty/tools/backend/jvm/ClassfileWriters.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ class ClassfileWriters(frontendAccess: PostProcessorFrontendAccess) {
125125
if (file.isInstanceOf[JarArchive]) {
126126
val jarCompressionLevel = compilerSettings.jarCompressionLevel
127127
// Writing to non-empty JAR might be an undefined behaviour, e.g. in case if other files where
128-
// created using `AbstractFile.bufferedOutputStream`instead of JarWritter
128+
// created using `AbstractFile.bufferedOutputStream`instead of JarWriter
129129
val jarFile = file.underlyingSource.getOrElse{
130130
throw new IllegalStateException("No underlying source for jar")
131131
}

Diff for: compiler/src/dotty/tools/dotc/CompilationUnit.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ class CompilationUnit protected (val source: SourceFile) {
7272
/** List of all comments present in this compilation unit */
7373
var comments: List[Comment] = Nil
7474

75-
/** Suspends the compilation unit by thowing a SuspendException
75+
/** Suspends the compilation unit by throwing a SuspendException
7676
* and recording the suspended compilation unit
7777
*/
7878
def suspend()(using Context): Nothing =

Diff for: compiler/src/dotty/tools/dotc/Compiler.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ class Compiler {
111111
new LetOverApply, // Lift blocks from receivers of applications
112112
new ArrayConstructors) :: // Intercept creation of (non-generic) arrays and intrinsify.
113113
List(new Erasure) :: // Rewrite types to JVM model, erasing all type parameters, abstract types and refinements.
114-
List(new ElimErasedValueType, // Expand erased value types to their underlying implmementation types
114+
List(new ElimErasedValueType, // Expand erased value types to their underlying implementation types
115115
new PureStats, // Remove pure stats from blocks
116116
new VCElideAllocations, // Peep-hole optimization to eliminate unnecessary value class allocations
117117
new EtaReduce, // Reduce eta expansions of pure paths to the underlying function reference

Diff for: compiler/src/dotty/tools/dotc/cc/CheckCaptures.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ object CheckCaptures:
4646
* @param owner the current owner
4747
* @param nestedInOwner true if the environment is a temporary one nested in the owner's environment,
4848
* and does not have a different actual owner symbol (this happens when doing box adaptation).
49-
* @param captured the caputure set containing all references to tracked free variables outside of boxes
49+
* @param captured the capture set containing all references to tracked free variables outside of boxes
5050
* @param isBoxed true if the environment is inside a box (in which case references are not counted)
5151
* @param outer0 the next enclosing environment
5252
*/

Diff for: compiler/src/dotty/tools/dotc/core/Annotations.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ object Annotations {
4343
def argumentConstantString(i: Int)(using Context): Option[String] =
4444
for (case Constant(s: String) <- argumentConstant(i)) yield s
4545

46-
/** The tree evaluaton is in progress. */
46+
/** The tree evaluation is in progress. */
4747
def isEvaluating: Boolean = false
4848

4949
/** The tree evaluation has finished. */

Diff for: compiler/src/dotty/tools/dotc/core/Contexts.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ object Contexts {
264264
/** SourceFile with given path, memoized */
265265
def getSource(path: String): SourceFile = getSource(path.toTermName)
266266

267-
/** AbstraFile with given path name, memoized */
267+
/** AbstractFile with given path name, memoized */
268268
def getFile(name: TermName): AbstractFile = base.files.get(name) match
269269
case Some(file) =>
270270
file

Diff for: compiler/src/dotty/tools/dotc/core/tasty/CommentPickler.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ object CommentPickler:
3232
def traverse(x: Any): Unit = x match
3333
case x: untpd.Tree @unchecked =>
3434
x match
35-
case x: tpd.MemberDef @unchecked => // at this point all MembderDefs are t(y)p(e)d.
35+
case x: tpd.MemberDef @unchecked => // at this point all MemberDefs are t(y)p(e)d.
3636
for comment <- docString(x) do pickleComment(addrOfTree(x), comment)
3737
case _ =>
3838
val limit = x.productArity

Diff for: compiler/src/dotty/tools/dotc/parsing/Scanners.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -683,7 +683,7 @@ object Scanners {
683683
if !r.isOutermost
684684
&& closingRegionTokens.contains(token)
685685
&& !(token == CASE && r.prefix == MATCH)
686-
&& next.token == EMPTY // can be violated for ill-formed programs, e.g. neg/i12605.sala
686+
&& next.token == EMPTY // can be violated for ill-formed programs, e.g. neg/i12605.scala
687687
=>
688688
insert(OUTDENT, offset)
689689
case _ =>

Diff for: compiler/src/dotty/tools/dotc/transform/CtxLazy.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import core.Contexts.*
99
* with a different context.
1010
*
1111
* A typical use case is a lazy val in a phase object which exists once per root context where
12-
* the expression intiializing the lazy val depends only on the root context, but not any changes afterwards.
12+
* the expression initializing the lazy val depends only on the root context, but not any changes afterwards.
1313
*/
1414
class CtxLazy[T](expr: Context ?=> T) {
1515
private var myValue: T = _

Diff for: compiler/src/dotty/tools/dotc/transform/ElimErasedValueType.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import NameKinds.SuperAccessorName
1313

1414
object ElimErasedValueType {
1515
val name: String = "elimErasedValueType"
16-
val description: String = "expand erased value types to their underlying implmementation types"
16+
val description: String = "expand erased value types to their underlying implementation types"
1717

1818
def elimEVT(tp: Type)(using Context): Type = tp match {
1919
case ErasedValueType(_, underlying) =>

Diff for: compiler/src/dotty/tools/dotc/transform/ExpandSAMs.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ class ExpandSAMs extends MiniPhase:
9494
* }
9595
* ```
9696
*
97-
* is expanded to an anomymous class:
97+
* is expanded to an anonymous class:
9898
*
9999
* ```
100100
* val x: PartialFunction[A, B] = {

Diff for: compiler/src/dotty/tools/dotc/transform/ExplicitOuter.scala

+2-2
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ class ExplicitOuter extends MiniPhase with InfoTransformer { thisPhase =>
101101
val parentCls = parent.tpe.classSymbol.asClass
102102
parent match
103103
// if we are in a regular class and first parent is also a regular class,
104-
// make sure we have a contructor
104+
// make sure we have a constructor
105105
case parent: TypeTree
106106
if !cls.is(Trait) && !parentCls.is(Trait) && !defn.NotRuntimeClasses.contains(parentCls) =>
107107
New(parent.tpe, Nil).withSpan(impl.span)
@@ -454,7 +454,7 @@ object ExplicitOuter {
454454
val enclClass = ctx.owner.lexicallyEnclosingClass.asClass
455455
val outerAcc = atPhaseNoLater(lambdaLiftPhase) {
456456
// lambdalift mangles local class names, which means we cannot
457-
// reliably find outer acessors anymore
457+
// reliably find outer accessors anymore
458458
tree match
459459
case tree: This if tree.symbol == enclClass && !enclClass.is(Trait) =>
460460
outerParamAccessor(enclClass)

Diff for: compiler/src/dotty/tools/dotc/transform/ReifiedReflect.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ trait ReifiedReflect:
5151
.select(defn.Quotes_reflect_TypeApply_apply)
5252
.appliedTo(fn, argTrees)
5353

54-
/** Create tree for `quotes.reflect.Assing(<lhs>, <rhs>)` */
54+
/** Create tree for `quotes.reflect.Assign(<lhs>, <rhs>)` */
5555
def Assign(lhs: Tree, rhs: Tree)(using Context) =
5656
self.select(defn.Quotes_reflect_Assign)
5757
.select(defn.Quotes_reflect_Assign_apply)

Diff for: compiler/src/dotty/tools/dotc/transform/SelectStatic.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import dotty.tools.dotc.transform.MegaPhase.*
1515
* Otherwise, the backend needs to be aware that some qualifiers need to be
1616
* dropped.
1717
*
18-
* A tranformation similar to what this phase does seems to be performed by
18+
* A transformation similar to what this phase does seems to be performed by
1919
* flatten in nsc.
2020
*
2121
* The side effects of the qualifier of a dropped `Select` is normally

Diff for: compiler/src/dotty/tools/dotc/typer/Synthesizer.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,7 @@ class Synthesizer(typer: Typer)(using @constructorOnly c: Context):
437437
MirrorSource.reduce(mirroredType) match
438438
case Right(msrc) => msrc match
439439
case MirrorSource.Singleton(_, tref) =>
440-
val singleton = tref.termSymbol // prefer alias name over the orignal name
440+
val singleton = tref.termSymbol // prefer alias name over the original name
441441
val singletonPath = tpd.singleton(tref).withSpan(span)
442442
if tref.classSymbol.is(Scala2x) then // could be Scala 3 alias of Scala 2 case object.
443443
val mirrorType = formal.constrained_& {

Diff for: compiler/src/dotty/tools/dotc/typer/Typer.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -1093,7 +1093,7 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
10931093
* For example, both `@Annot(5)` and `@Annot({5, 6}) are viable calls of the constructor
10941094
* of annotation defined as `@interface Annot { int[] value() }`
10951095
* We assume that calling `typedNamedArg` in context of Java implies that we are dealing
1096-
* with annotation contructor, as named arguments are not allowed anywhere else in Java.
1096+
* with annotation constructor, as named arguments are not allowed anywhere else in Java.
10971097
* Under explicit nulls, the pt could be nullable. We need to strip `Null` type first.
10981098
*/
10991099
val arg1 = pt.stripNull match {

Diff for: docs/_docs/contributing/architecture/phases.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ Finally are [staging], which ensures that quotes conform to the
6363
trees to embedded TASTy strings.
6464

6565
### `transformPhases`
66-
These phases are concerned with tranformation into lower-level forms
66+
These phases are concerned with transformation into lower-level forms
6767
suitable for the runtime system, with two sub-groupings:
6868
- High-level transformations: All phases from [firstTransform] to [erasure].
6969
Most of these phases transform syntax trees, expanding high-level constructs

Diff for: docs/_docs/internals/overall-structure.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ phases. The current list of phases is specified in class [Compiler] as follows:
160160
new LetOverApply, // Lift blocks from receivers of applications
161161
new ArrayConstructors) :: // Intercept creation of (non-generic) arrays and intrinsify.
162162
List(new Erasure) :: // Rewrite types to JVM model, erasing all type parameters, abstract types and refinements.
163-
List(new ElimErasedValueType, // Expand erased value types to their underlying implmementation types
163+
List(new ElimErasedValueType, // Expand erased value types to their underlying implementation types
164164
new PureStats, // Remove pure stats from blocks
165165
new VCElideAllocations, // Peep-hole optimization to eliminate unnecessary value class allocations
166166
new ArrayApply, // Optimize `scala.Array.apply([....])` and `scala.Array.apply(..., [....])` into `[...]`

Diff for: presentation-compiler/test/dotty/tools/pc/tests/completion/CompletionArgSuite.scala

+2-2
Original file line numberDiff line numberDiff line change
@@ -583,7 +583,7 @@ class CompletionArgSuite extends BaseCompletionSuite:
583583
|""".stripMargin
584584
)
585585

586-
@Test def `contructor-param` =
586+
@Test def `constructor-param` =
587587
check(
588588
"""|class Foo (xxx: Int)
589589
|
@@ -595,7 +595,7 @@ class CompletionArgSuite extends BaseCompletionSuite:
595595
|""".stripMargin
596596
)
597597

598-
@Test def `contructor-param2` =
598+
@Test def `constructor-param2` =
599599
check(
600600
"""|class Foo ()
601601
|

Diff for: scaladoc/src/dotty/tools/scaladoc/tasty/BasicSupport.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ trait BasicSupport:
4848
"scala.transient",
4949
"scala.volatile",
5050
"scala.annotation.experimental",
51-
"scala.annotation.contructorOnly",
51+
"scala.annotation.constructorOnly",
5252
"scala.annotation.static",
5353
"scala.annotation.targetName",
5454
"scala.annotation.threadUnsafe",

Diff for: tests/old-tasty-interpreter-prototype/interpreter/TreeInterpreter.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ abstract class TreeInterpreter[Q <: Quotes & Singleton](using val q: Q) {
146146
}
147147

148148
case Assign(lhs, rhs) =>
149-
log("<interpretAssing>", tree)(localValue(lhs.symbol).update(eval(rhs)))
149+
log("<interpretAssign>", tree)(localValue(lhs.symbol).update(eval(rhs)))
150150

151151
case If(cond, thenp, elsep) => log("interpretIf", tree)(interpretIf(cond, thenp, elsep))
152152
case While(cond, body) => log("interpretWhile", tree)(interpretWhile(cond, body))

Diff for: tests/pos-with-compiler-cc/dotc/CompilationUnit.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ class CompilationUnit protected (val source: SourceFile) {
6666
/** Can this compilation unit be suspended */
6767
def isSuspendable: Boolean = true
6868

69-
/** Suspends the compilation unit by thowing a SuspendException
69+
/** Suspends the compilation unit by throwing a SuspendException
7070
* and recording the suspended compilation unit
7171
*/
7272
def suspend()(using Context): Nothing =

Diff for: tests/pos-with-compiler-cc/dotc/Compiler.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ class Compiler {
107107
new LetOverApply, // Lift blocks from receivers of applications
108108
new ArrayConstructors) :: // Intercept creation of (non-generic) arrays and intrinsify.
109109
List(new Erasure) :: // Rewrite types to JVM model, erasing all type parameters, abstract types and refinements.
110-
List(new ElimErasedValueType, // Expand erased value types to their underlying implmementation types
110+
List(new ElimErasedValueType, // Expand erased value types to their underlying implementation types
111111
new PureStats, // Remove pure stats from blocks
112112
new VCElideAllocations, // Peep-hole optimization to eliminate unnecessary value class allocations
113113
new EtaReduce, // Reduce eta expansions of pure paths to the underlying function reference

Diff for: tests/pos-with-compiler-cc/dotc/config/Config.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ object Config {
248248
*/
249249
inline val printCaptureSetsAsPrefix = true
250250

251-
/** If true, allow mappping capture set variables under captureChecking with maps that are neither
251+
/** If true, allow mapping capture set variables under captureChecking with maps that are neither
252252
* bijective nor idempotent. We currently do now know how to do this correctly in all
253253
* cases, though.
254254
*/

Diff for: tests/pos-with-compiler-cc/dotc/core/Contexts.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ object Contexts {
252252
/** SourceFile with given path, memoized */
253253
def getSource(path: String): SourceFile = getSource(path.toTermName)
254254

255-
/** AbstraFile with given path name, memoized */
255+
/** AbstractFile with given path name, memoized */
256256
def getFile(name: TermName): AbstractFile = base.files.get(name) match
257257
case Some(file) =>
258258
file

Diff for: tests/pos-with-compiler-cc/dotc/core/tasty/CommentPickler.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class CommentPickler(pickler: TastyPickler, addrOfTree: tpd.Tree => Addr, docStr
2727
private def traverse(x: Any): Unit = x match
2828
case x: untpd.Tree @unchecked =>
2929
x match
30-
case x: tpd.MemberDef @unchecked => // at this point all MembderDefs are t(y)p(e)d.
30+
case x: tpd.MemberDef @unchecked => // at this point all MemberDefs are t(y)p(e)d.
3131
for comment <- docString(x) do pickleComment(addrOfTree(x), comment)
3232
case _ =>
3333
val limit = x.productArity

Diff for: tests/pos-with-compiler-cc/dotc/parsing/Scanners.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -667,7 +667,7 @@ object Scanners {
667667
if !r.isOutermost
668668
&& closingRegionTokens.contains(token)
669669
&& !(token == CASE && r.prefix == MATCH)
670-
&& next.token == EMPTY // can be violated for ill-formed programs, e.g. neg/i12605.sala
670+
&& next.token == EMPTY // can be violated for ill-formed programs, e.g. neg/i12605.scala
671671
=>
672672
insert(OUTDENT, offset)
673673
case _ =>

Diff for: tests/pos-with-compiler-cc/dotc/transform/CtxLazy.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import core.Contexts._
99
* with a different context.
1010
*
1111
* A typical use case is a lazy val in a phase object which exists once per root context where
12-
* the expression intiializing the lazy val depends only on the root context, but not any changes afterwards.
12+
* the expression initializing the lazy val depends only on the root context, but not any changes afterwards.
1313
*/
1414
class CtxLazy[T](expr: Context ?=> T) {
1515
private var myValue: T = _

Diff for: tests/pos-with-compiler-cc/dotc/transform/ElimErasedValueType.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import NameKinds.SuperAccessorName
1313

1414
object ElimErasedValueType {
1515
val name: String = "elimErasedValueType"
16-
val description: String = "expand erased value types to their underlying implmementation types"
16+
val description: String = "expand erased value types to their underlying implementation types"
1717

1818
def elimEVT(tp: Type)(using Context): Type = tp match {
1919
case ErasedValueType(_, underlying) =>

Diff for: tests/pos-with-compiler-cc/dotc/transform/ExpandSAMs.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ class ExpandSAMs extends MiniPhase:
8888
* }
8989
* ```
9090
*
91-
* is expanded to an anomymous class:
91+
* is expanded to an anonymous class:
9292
*
9393
* ```
9494
* val x: PartialFunction[A, B] = {

Diff for: tests/pos-with-compiler-cc/dotc/transform/ExplicitOuter.scala

+2-2
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ class ExplicitOuter extends MiniPhase with InfoTransformer { thisPhase =>
100100
val parentCls = parent.tpe.classSymbol.asClass
101101
parent match
102102
// if we are in a regular class and first parent is also a regular class,
103-
// make sure we have a contructor
103+
// make sure we have a constructor
104104
case parent: TypeTree
105105
if !cls.is(Trait) && !parentCls.is(Trait) && !defn.NotRuntimeClasses.contains(parentCls) =>
106106
New(parent.tpe, Nil).withSpan(impl.span)
@@ -459,7 +459,7 @@ object ExplicitOuter {
459459
val enclClass = ctx.owner.lexicallyEnclosingClass.asClass
460460
val outerAcc = atPhaseNoLater(lambdaLiftPhase) {
461461
// lambdalift mangles local class names, which means we cannot
462-
// reliably find outer acessors anymore
462+
// reliably find outer accessors anymore
463463
tree match
464464
case tree: This if tree.symbol == enclClass && !enclClass.is(Trait) =>
465465
outerParamAccessor(enclClass)

Diff for: tests/pos-with-compiler-cc/dotc/transform/ReifiedReflect.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ trait ReifiedReflect:
5252
.select(defn.Quotes_reflect_TypeApply_apply)
5353
.appliedTo(fn, argTrees)
5454

55-
/** Create tree for `quotes.reflect.Assing(<lhs>, <rhs>)` */
55+
/** Create tree for `quotes.reflect.Assign(<lhs>, <rhs>)` */
5656
def Assign(lhs: Tree, rhs: Tree)(using Context) =
5757
self.select(defn.Quotes_reflect_Assign)
5858
.select(defn.Quotes_reflect_Assign_apply)

Diff for: tests/pos-with-compiler-cc/dotc/transform/SelectStatic.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import dotty.tools.dotc.transform.SymUtils._
1515
* Otherwise, the backend needs to be aware that some qualifiers need to be
1616
* dropped.
1717
*
18-
* A tranformation similar to what this phase does seems to be performed by
18+
* A transformation similar to what this phase does seems to be performed by
1919
* flatten in nsc.
2020
*
2121
* The side effects of the qualifier of a dropped `Select` is normally

Diff for: tests/pos-with-compiler-cc/dotc/typer/Synthesizer.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@ class Synthesizer(typer: Typer)(using @constructorOnly c: Context):
431431
MirrorSource.reduce(mirroredType) match
432432
case Right(msrc) => msrc match
433433
case MirrorSource.Singleton(_, tref) =>
434-
val singleton = tref.termSymbol // prefer alias name over the orignal name
434+
val singleton = tref.termSymbol // prefer alias name over the original name
435435
val singletonPath = pathFor(tref).withSpan(span)
436436
if tref.classSymbol.is(Scala2x) then // could be Scala 3 alias of Scala 2 case object.
437437
val mirrorType = formal.constrained_& {

Diff for: tests/pos-with-compiler-cc/dotc/typer/Typer.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -959,7 +959,7 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
959959
* For example, both `@Annot(5)` and `@Annot({5, 6}) are viable calls of the constructor
960960
* of annotation defined as `@interface Annot { int[] value() }`
961961
* We assume that calling `typedNamedArg` in context of Java implies that we are dealing
962-
* with annotation contructor, as named arguments are not allowed anywhere else in Java.
962+
* with annotation constructor, as named arguments are not allowed anywhere else in Java.
963963
* Under explicit nulls, the pt could be nullable. We need to strip `Null` type first.
964964
*/
965965
val arg1 = pt.stripNull match {

Diff for: tests/warn/i15503c.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class A:
3232
def z = g // OK
3333
var w = 2 // OK
3434

35-
package foo.test.contructors:
35+
package foo.test.constructors:
3636
case class A private (x:Int) // OK
3737
class B private (val x: Int) // OK
3838
class C private (private val x: Int) // warn

0 commit comments

Comments
 (0)