Skip to content

Commit d5b1000

Browse files
SethTisueKordyjan
authored andcommitted
fix assorted typos
[Cherry-picked 5836f40]
1 parent 187b4e4 commit d5b1000

File tree

35 files changed

+70
-70
lines changed

35 files changed

+70
-70
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -763,7 +763,7 @@ object Trees {
763763
}
764764

765765
/** Tree that replaces a level 1 splices in pickled (level 0) quotes.
766-
* It is only used when picking quotes (will never be in a TASTy file).
766+
* It is only used when pickling quotes (will never be in a TASTy file).
767767
*
768768
* @param isTerm If this hole is a term, otherwise it is a type hole.
769769
* @param idx The index of the hole in it's enclosing level 0 quote.

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ trait ConstraintHandling {
102102
*
103103
* If we trust bounds, then the lower bound of `X` is `x.M` since `x.M >: 1`.
104104
* Then even if we correct levels on instantiation to eliminate the local `x`,
105-
* it is alreay too late, we'd get `Int & String` as instance, which does not
105+
* it is already too late, we'd get `Int & String` as instance, which does not
106106
* satisfy the original constraint `X >: 1`.
107107
*
108108
* But if `trustBounds` is false, we do not conclude the `x.M >: 1` since
@@ -708,8 +708,8 @@ trait ConstraintHandling {
708708
// Widening can add extra constraints, in particular the widened type might
709709
// be a type variable which is now instantiated to `param`, and therefore
710710
// cannot be used as an instantiation of `param` without creating a loop.
711-
// If that happens, we run `instanceType` again to find a new instantation.
712-
// (we do not check for non-toplevel occurences: those should never occur
711+
// If that happens, we run `instanceType` again to find a new instantiation.
712+
// (we do not check for non-toplevel occurrences: those should never occur
713713
// since `addOneBound` disallows recursive lower bounds).
714714
if constraint.occursAtToplevel(param, widened) then
715715
instanceType(param, fromBelow, widenUnions, maxLevel)

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ object Symbols {
7777

7878
/** Does this symbol retain its definition tree?
7979
* A good policy for this needs to balance costs and benefits, where
80-
* costs are mainly memoty leaks, in particular across runs.
80+
* costs are mainly memory leaks, in particular across runs.
8181
*/
8282
def retainsDefTree(using Context): Boolean =
8383
ctx.settings.YretainTrees.value ||

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ class TypeApplications(val self: Type) extends AnyVal {
406406
if (typeParams.nonEmpty) appliedTo(args) else self
407407

408408
/** A cycle-safe version of `appliedTo` where computing type parameters do not force
409-
* the typeconstructor. Instead, if the type constructor is completing, we make
409+
* the type constructor. Instead, if the type constructor is completing, we make
410410
* up hk type parameters matching the arguments. This is needed when unpickling
411411
* Scala2 files such as `scala.collection.generic.Mapfactory`.
412412
*/

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1751,7 +1751,7 @@ class TypeComparer(@constructorOnly initctx: Context) extends ConstraintHandling
17511751
* any, or no constraint at all.
17521752
*
17531753
* Otherwise, we infer _sufficient_ constraints: we try to keep the smaller of
1754-
* the two constraints, but if never is smaller than the other, we just pick
1754+
* the two constraints, but if neither is smaller than the other, we just pick
17551755
* the first one.
17561756
*/
17571757
protected def either(op1: => Boolean, op2: => Boolean): Boolean =
@@ -1961,7 +1961,7 @@ class TypeComparer(@constructorOnly initctx: Context) extends ConstraintHandling
19611961
// is that if the refinement does not refer to a member symbol, we will have to
19621962
// resort to reflection to invoke the member. And Java reflection needs to know exact
19631963
// erased parameter types. See neg/i12211.scala. Other reflection algorithms could
1964-
// conceivably dispatch without knowning precise parameter signatures. One can signal
1964+
// conceivably dispatch without knowing precise parameter signatures. One can signal
19651965
// this by inheriting from the `scala.reflect.SignatureCanBeImprecise` marker trait,
19661966
// in which case the signature test is elided.
19671967
def sigsOK(symInfo: Type, info2: Type) =
@@ -2785,7 +2785,7 @@ class TypeComparer(@constructorOnly initctx: Context) extends ConstraintHandling
27852785
else
27862786
false
27872787
case (AppliedType(tycon1, args1), AppliedType(tycon2, args2)) if isSame(tycon1, tycon2) =>
2788-
// It is possible to conclude that two types applies are disjoint by
2788+
// It is possible to conclude that two types applied are disjoint by
27892789
// looking at covariant type parameters if the said type parameters
27902790
// are disjoin and correspond to fields.
27912791
// (Type parameter disjointness is not enough by itself as it could

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3340,7 +3340,7 @@ object Types {
33403340
def isAnd: Boolean = true
33413341
private var myBaseClassesPeriod: Period = Nowhere
33423342
private var myBaseClasses: List[ClassSymbol] = _
3343-
/** Base classes of are the merge of the operand base classes. */
3343+
/** Base classes are the merge of the operand base classes. */
33443344
override final def baseClasses(using Context): List[ClassSymbol] = {
33453345
if (myBaseClassesPeriod != ctx.period) {
33463346
val bcs1 = tp1.baseClasses
@@ -3433,7 +3433,7 @@ object Types {
34333433
def isSoft: Boolean
34343434
private var myBaseClassesPeriod: Period = Nowhere
34353435
private var myBaseClasses: List[ClassSymbol] = _
3436-
/** Base classes of are the intersection of the operand base classes. */
3436+
/** Base classes are the intersection of the operand base classes. */
34373437
override final def baseClasses(using Context): List[ClassSymbol] = {
34383438
if (myBaseClassesPeriod != ctx.period) {
34393439
val bcs1 = tp1.baseClasses

compiler/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ class TreeUnpickler(reader: TastyReader,
263263
/** Read reference to definition and return symbol created at that definition */
264264
def readSymRef()(using Context): Symbol = symbolAt(readAddr())
265265

266-
/** The symbol at given address; createa new one if none exists yet */
266+
/** The symbol at given address; create a new one if none exists yet */
267267
def symbolAt(addr: Addr)(using Context): Symbol = symAtAddr.get(addr) match {
268268
case Some(sym) =>
269269
sym

compiler/src/dotty/tools/dotc/inlines/Inliner.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ class Inliner(val call: tpd.Tree)(using Context):
177177
/** A map from the classes of (direct and outer) this references in `rhsToInline`
178178
* to references of their proxies.
179179
* Note that we can't index by the ThisType itself since there are several
180-
* possible forms to express what is logicaly the same ThisType. E.g.
180+
* possible forms to express what is logically the same ThisType. E.g.
181181
*
182182
* ThisType(TypeRef(ThisType(p), cls))
183183
*
@@ -338,7 +338,7 @@ class Inliner(val call: tpd.Tree)(using Context):
338338

339339
protected def hasOpaqueProxies = opaqueProxies.nonEmpty
340340

341-
/** Map first halfs of opaqueProxies pairs to second halfs, using =:= as equality */
341+
/** Map first halves of opaqueProxies pairs to second halves, using =:= as equality */
342342
private def mapRef(ref: TermRef): Option[TermRef] =
343343
opaqueProxies.collectFirst {
344344
case (from, to) if from.symbol == ref.symbol && from =:= ref => to
@@ -1047,13 +1047,13 @@ class Inliner(val call: tpd.Tree)(using Context):
10471047
val evaluatedSplice = inContext(quoted.MacroExpansion.context(inlinedFrom)) {
10481048
Splicer.splice(body, splicePos, inlinedFrom.srcPos, MacroClassLoader.fromContext)
10491049
}
1050-
val inlinedNormailizer = new TreeMap {
1050+
val inlinedNormalizer = new TreeMap {
10511051
override def transform(tree: tpd.Tree)(using Context): tpd.Tree = tree match {
10521052
case Inlined(EmptyTree, Nil, expr) if enclosingInlineds.isEmpty => transform(expr)
10531053
case _ => super.transform(tree)
10541054
}
10551055
}
1056-
val normalizedSplice = inlinedNormailizer.transform(evaluatedSplice)
1056+
val normalizedSplice = inlinedNormalizer.transform(evaluatedSplice)
10571057
if (normalizedSplice.isEmpty) normalizedSplice
10581058
else normalizedSplice.withSpan(splicePos.span)
10591059
}

compiler/src/dotty/tools/dotc/quoted/Interpreter.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class Interpreter(pos: SrcPos, classLoader0: ClassLoader)(using Context):
4747

4848
/** Returns the result of interpreting the code in the tree.
4949
* Return Some of the result or None if the result type is not consistent with the expected type.
50-
* Throws a StopInterpretation if the tree could not be interpreted or a runtime exception ocurred.
50+
* Throws a StopInterpretation if the tree could not be interpreted or a runtime exception occurred.
5151
*/
5252
final def interpret[T](tree: Tree)(using ct: ClassTag[T]): Option[T] =
5353
interpretTree(tree)(using emptyEnv) match {
@@ -59,7 +59,7 @@ class Interpreter(pos: SrcPos, classLoader0: ClassLoader)(using Context):
5959
}
6060

6161
/** Returns the result of interpreting the code in the tree.
62-
* Throws a StopInterpretation if the tree could not be interpreted or a runtime exception ocurred.
62+
* Throws a StopInterpretation if the tree could not be interpreted or a runtime exception occurred.
6363
*/
6464
protected def interpretTree(tree: Tree)(using Env): Object = tree match {
6565
case Literal(Constant(value)) =>

compiler/src/dotty/tools/dotc/transform/MegaPhase.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ object MegaPhase {
2626
*
2727
* - Stats: to prepare/transform a statement sequence in a block, template, or package def,
2828
* - Unit : to prepare/transform a whole compilation unit
29-
* - Other: to prepape/transform a tree that does not have a specific prepare/transform
29+
* - Other: to prepare/transform a tree that does not have a specific prepare/transform
3030
* method pair.
3131
*/
3232
abstract class MiniPhase extends Phase {

compiler/src/dotty/tools/dotc/transform/Recheck.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,7 @@ abstract class Recheck extends Phase, SymTransformer:
497497
throw ex
498498
}
499499

500-
/** Typing and previous transforms sometiems leaves skolem types in prefixes of
500+
/** Typing and previous transforms sometimes leaves skolem types in prefixes of
501501
* NamedTypes in `expected` that do not match the `actual` Type. -Ycheck does
502502
* not complain (need to find out why), but a full recheck does. We compensate
503503
* by de-skolemizing everywhere in `expected` except when variance is negative.

compiler/src/dotty/tools/dotc/transform/SpecializeFunctions.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ class SpecializeFunctions extends MiniPhase {
8585
case Select(qual, _) =>
8686
val qual1 = qual.tpe.widen match
8787
case defn.ByNameFunction(res) =>
88-
// Need to cast to regular function, since specialied apply methods
88+
// Need to cast to regular function, since specialized apply methods
8989
// are not members of ContextFunction0. The cast will be eliminated in
9090
// erasure.
9191
qual.cast(defn.FunctionOf(Nil, res))

compiler/src/dotty/tools/dotc/transform/SymUtils.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ object SymUtils:
101101
else if (self.is(Abstract)) "it is an abstract class"
102102
else if (self.primaryConstructor.info.paramInfoss.length != 1) "it takes more than one parameter list"
103103
else if (isDerivedValueClass(self)) "it is a value class"
104-
else if (!(companionMirror || canAccessCtor)) s"the constructor of $self is innaccessible from the calling scope."
104+
else if (!(companionMirror || canAccessCtor)) s"the constructor of $self is inaccessible from the calling scope."
105105
else ""
106106
end whyNotGenericProduct
107107

compiler/src/dotty/tools/dotc/transform/patmat/Space.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ object SpaceEngine {
444444
*
445445
* We cannot use type erasure here, as it would lose the constraints
446446
* involving GADTs. For example, in the following code, type
447-
* erasure would loose the constraint that `x` and `y` must be
447+
* erasure would lose the constraint that `x` and `y` must be
448448
* the same type, resulting in false inexhaustive warnings:
449449
*
450450
* sealed trait Expr[T]

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ object Checking {
371371

372372
/** Check that `info` of symbol `sym` is not cyclic.
373373
* @pre sym is not yet initialized (i.e. its type is a Completer).
374-
* @return `info` where every legal F-bounded reference is proctected
374+
* @return `info` where every legal F-bounded reference is protected
375375
* by a `LazyRef`, or `ErrorType` if a cycle was detected and reported.
376376
*/
377377
def checkNonCyclic(sym: Symbol, info: Type, reportErrors: Boolean)(using Context): Type = {

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ object Inferencing {
141141
* 3. T is minimized if it has a lower bound (different from Nothing) in the
142142
* current constraint (the bound might come from T's declaration).
143143
* 4. Otherwise, T is maximized if it has an upper bound (different from Any)
144-
* in the currented constraint (the bound might come from T's declaration).
144+
* in the current constraint (the bound might come from T's declaration).
145145
* 5. Otherwise, T is not instantiated at all.
146146
147147
* If (1) and (2) do not apply, and minimizeSelected is not set:
@@ -244,16 +244,16 @@ object Inferencing {
244244
* relationship _necessarily_ must hold.
245245
*
246246
* We accomplish that by:
247-
* - replacing covariant occurences with upper GADT bound
248-
* - replacing contravariant occurences with lower GADT bound
249-
* - leaving invariant occurences alone
247+
* - replacing covariant occurrences with upper GADT bound
248+
* - replacing contravariant occurrences with lower GADT bound
249+
* - leaving invariant occurrences alone
250250
*
251251
* Examples:
252252
* - If we have GADT cstr A <: Int, then for all A <: Int, Option[A] <: Option[Int].
253253
* Therefore, we can approximate Option[A] ~~ Option[Int].
254254
* - If we have A >: S <: T, then for all such A, A => A <: S => T. This
255255
* illustrates that it's fine to differently approximate different
256-
* occurences of same type.
256+
* occurrences of same type.
257257
* - If we have A <: Int and F <: [A] => Option[A] (note the invariance),
258258
* then we should approximate F[A] ~~ Option[A]. That is, we should
259259
* respect the invariance of the type constructor.
@@ -453,7 +453,7 @@ object Inferencing {
453453
* +1 means: only covariant occurrences
454454
* 0 means: mixed or non-variant occurrences
455455
*
456-
* We need to take the occurences in `pt` into account because a type
456+
* We need to take the occurrences in `pt` into account because a type
457457
* variable created when typing the current tree might only appear in the
458458
* bounds of a type variable in the expected type, for example when
459459
* `ConstraintHandling#legalBound` creates type variables when approximating
@@ -568,7 +568,7 @@ trait Inferencing { this: Typer =>
568568
* Eligible for interpolation are all type variables owned by the current typerstate
569569
* that are not in `locked` and whose `nestingLevel` is `>= ctx.nestingLevel`.
570570
* Type variables occurring co- (respectively, contra-) variantly in the tree type
571-
* or expected type are minimized (respectvely, maximized). Non occurring type variables are minimized if they
571+
* or expected type are minimized (respectively, maximized). Non occurring type variables are minimized if they
572572
* have a lower bound different from Nothing, maximized otherwise. Type variables appearing
573573
* non-variantly in the type are left untouched.
574574
*

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ trait TypeAssigner {
122122
val qualType0 = qual1.tpe.widenIfUnstable
123123
val qualType =
124124
if !qualType0.hasSimpleKind && tree.name != nme.CONSTRUCTOR then
125-
// constructors are selected on typeconstructor, type arguments are passed afterwards
125+
// constructors are selected on type constructor, type arguments are passed afterwards
126126
errorType(em"$qualType0 takes type parameters", qual1.srcPos)
127127
else if !qualType0.isInstanceOf[TermType] && !qualType0.isError then
128128
errorType(em"$qualType0 is illegal as a selection prefix", qual1.srcPos)

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2138,7 +2138,7 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
21382138
// any references to other parameter types of the underlying hk lambda
21392139
// in order not to get orphan parameters. Test case in pos/i15564.scala.
21402140
// Note 1: It would be better to substitute actual arguments for corresponding
2141-
// formal paramaters, but it looks very hard to do this at the point where
2141+
// formal parameters, but it looks very hard to do this at the point where
21422142
// a bound type variable is created.
21432143
// Note 2: If the type constructor is a class type, no sanitization is needed
21442144
// since we can refer to the other paraeters with dependent types C[...]#X.
@@ -3485,7 +3485,7 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
34853485
val app = tryExtMethod(alt)(using nestedCtx)
34863486
(if nestedCtx.reporter.hasErrors then failures else successes)
34873487
+= ((app, nestedCtx.typerState))
3488-
typr.println(i"multiple extensioin methods, success: ${successes.toList}, failure: ${failures.toList}")
3488+
typr.println(i"multiple extension methods, success: ${successes.toList}, failure: ${failures.toList}")
34893489

34903490
def pick(alt: (Tree, TyperState)): Tree =
34913491
val (app, ts) = alt

dist/bin/common.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ if defined JAVACMD (
1313
set __JAVA_BIN_DIR=
1414
for /f "delims=" %%i in ('where /f java.exe') do (
1515
set "__PATH=%%~dpi"
16-
@rem we take first occurence and ignore Oracle path for java executable
16+
@rem we take first occurrence and ignore Oracle path for java executable
1717
if not defined __JAVA_BIN_DIR if "!__PATH!"=="!__PATH:javapath=!" set "__JAVA_BIN_DIR=!__PATH!"
1818
)
1919
if defined __JAVA_BIN_DIR set "_JAVACMD=!__JAVA_BIN_DIR!\java.exe"

docs/_docs/reference/dropped-features/existential-types.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ have been dropped. The reasons for dropping them are:
1010

1111
- Existential types violate a type soundness principle on which DOT
1212
and Scala 3 are constructed. That principle says that every
13-
prefix (`p`, respectvely `S`) of a type selection `p.T` or `S#T`
13+
prefix (`p`, respectively `S`) of a type selection `p.T` or `S#T`
1414
must either come from a value constructed at runtime or refer to a
1515
type that is known to have only good bounds.
1616

docs/_docs/reference/metaprogramming/compiletime-ops.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ enabling us to handle situations where a value is not present. Note that `S` is
3030
the type of the successor of some singleton type. For example the type `S[1]` is
3131
the singleton type `2`.
3232

33-
Since tuples are not constant types, even if their constituants are, there is `constValueTuple`, which given a tuple type `(X1, ..., Xn)`, returns a tuple value `(constValue[X1], ..., constValue[Xn])`.
33+
Since tuples are not constant types, even if their constituents are, there is `constValueTuple`, which given a tuple type `(X1, ..., Xn)`, returns a tuple value `(constValue[X1], ..., constValue[Xn])`.
3434

3535
### `erasedValue`
3636

docs/_spec/APPLIEDreference/dropped-features/existential-types.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ have been dropped. The reasons for dropping them are:
1010

1111
- Existential types violate a type soundness principle on which DOT
1212
and Scala 3 are constructed. That principle says that every
13-
prefix (`p`, respectvely `S`) of a type selection `p.T` or `S#T`
13+
prefix (`p`, respectively `S`) of a type selection `p.T` or `S#T`
1414
must either come from a value constructed at runtime or refer to a
1515
type that is known to have only good bounds.
1616

0 commit comments

Comments
 (0)