Skip to content

Commit 5836f40

Browse files
committed
fix assorted typos
1 parent 967aefc commit 5836f40

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
@@ -774,7 +774,7 @@ object Trees {
774774
}
775775

776776
/** Tree that replaces a level 1 splices in pickled (level 0) quotes.
777-
* It is only used when picking quotes (will never be in a TASTy file).
777+
* It is only used when pickling quotes (will never be in a TASTy file).
778778
*
779779
* @param isTerm If this hole is a term, otherwise it is a type hole.
780780
* @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
@@ -110,7 +110,7 @@ trait ConstraintHandling {
110110
*
111111
* If we trust bounds, then the lower bound of `X` is `x.M` since `x.M >: 1`.
112112
* Then even if we correct levels on instantiation to eliminate the local `x`,
113-
* it is alreay too late, we'd get `Int & String` as instance, which does not
113+
* it is already too late, we'd get `Int & String` as instance, which does not
114114
* satisfy the original constraint `X >: 1`.
115115
*
116116
* But if `trustBounds` is false, we do not conclude the `x.M >: 1` since
@@ -716,8 +716,8 @@ trait ConstraintHandling {
716716
// Widening can add extra constraints, in particular the widened type might
717717
// be a type variable which is now instantiated to `param`, and therefore
718718
// cannot be used as an instantiation of `param` without creating a loop.
719-
// If that happens, we run `instanceType` again to find a new instantation.
720-
// (we do not check for non-toplevel occurences: those should never occur
719+
// If that happens, we run `instanceType` again to find a new instantiation.
720+
// (we do not check for non-toplevel occurrences: those should never occur
721721
// since `addOneBound` disallows recursive lower bounds).
722722
if constraint.occursAtToplevel(param, widened) then
723723
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
@@ -78,7 +78,7 @@ object Symbols {
7878

7979
/** Does this symbol retain its definition tree?
8080
* A good policy for this needs to balance costs and benefits, where
81-
* costs are mainly memoty leaks, in particular across runs.
81+
* costs are mainly memory leaks, in particular across runs.
8282
*/
8383
def retainsDefTree(using Context): Boolean =
8484
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
@@ -1795,7 +1795,7 @@ class TypeComparer(@constructorOnly initctx: Context) extends ConstraintHandling
17951795
* any, or no constraint at all.
17961796
*
17971797
* Otherwise, we infer _sufficient_ constraints: we try to keep the smaller of
1798-
* the two constraints, but if never is smaller than the other, we just pick
1798+
* the two constraints, but if neither is smaller than the other, we just pick
17991799
* the first one.
18001800
*/
18011801
protected def either(op1: => Boolean, op2: => Boolean): Boolean =
@@ -2005,7 +2005,7 @@ class TypeComparer(@constructorOnly initctx: Context) extends ConstraintHandling
20052005
// is that if the refinement does not refer to a member symbol, we will have to
20062006
// resort to reflection to invoke the member. And Java reflection needs to know exact
20072007
// erased parameter types. See neg/i12211.scala. Other reflection algorithms could
2008-
// conceivably dispatch without knowning precise parameter signatures. One can signal
2008+
// conceivably dispatch without knowing precise parameter signatures. One can signal
20092009
// this by inheriting from the `scala.reflect.SignatureCanBeImprecise` marker trait,
20102010
// in which case the signature test is elided.
20112011
def sigsOK(symInfo: Type, info2: Type) =
@@ -2838,7 +2838,7 @@ class TypeComparer(@constructorOnly initctx: Context) extends ConstraintHandling
28382838
else
28392839
false
28402840
case (AppliedType(tycon1, args1), AppliedType(tycon2, args2)) if isSame(tycon1, tycon2) =>
2841-
// It is possible to conclude that two types applies are disjoint by
2841+
// It is possible to conclude that two types applied are disjoint by
28422842
// looking at covariant type parameters if the said type parameters
28432843
// are disjoin and correspond to fields.
28442844
// (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
@@ -3357,7 +3357,7 @@ object Types {
33573357
def isAnd: Boolean = true
33583358
private var myBaseClassesPeriod: Period = Nowhere
33593359
private var myBaseClasses: List[ClassSymbol] = _
3360-
/** Base classes of are the merge of the operand base classes. */
3360+
/** Base classes are the merge of the operand base classes. */
33613361
override final def baseClasses(using Context): List[ClassSymbol] = {
33623362
if (myBaseClassesPeriod != ctx.period) {
33633363
val bcs1 = tp1.baseClasses
@@ -3450,7 +3450,7 @@ object Types {
34503450
def isSoft: Boolean
34513451
private var myBaseClassesPeriod: Period = Nowhere
34523452
private var myBaseClasses: List[ClassSymbol] = _
3453-
/** Base classes of are the intersection of the operand base classes. */
3453+
/** Base classes are the intersection of the operand base classes. */
34543454
override final def baseClasses(using Context): List[ClassSymbol] = {
34553455
if (myBaseClassesPeriod != ctx.period) {
34563456
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
@@ -264,7 +264,7 @@ class TreeUnpickler(reader: TastyReader,
264264
/** Read reference to definition and return symbol created at that definition */
265265
def readSymRef()(using Context): Symbol = symbolAt(readAddr())
266266

267-
/** The symbol at given address; createa new one if none exists yet */
267+
/** The symbol at given address; create a new one if none exists yet */
268268
def symbolAt(addr: Addr)(using Context): Symbol = symAtAddr.get(addr) match {
269269
case Some(sym) =>
270270
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
@@ -434,7 +434,7 @@ object SpaceEngine {
434434
*
435435
* We cannot use type erasure here, as it would lose the constraints
436436
* involving GADTs. For example, in the following code, type
437-
* erasure would loose the constraint that `x` and `y` must be
437+
* erasure would lose the constraint that `x` and `y` must be
438438
* the same type, resulting in false inexhaustive warnings:
439439
*
440440
* 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
@@ -377,7 +377,7 @@ object Checking {
377377

378378
/** Check that `info` of symbol `sym` is not cyclic.
379379
* @pre sym is not yet initialized (i.e. its type is a Completer).
380-
* @return `info` where every legal F-bounded reference is proctected
380+
* @return `info` where every legal F-bounded reference is protected
381381
* by a `LazyRef`, or `ErrorType` if a cycle was detected and reported.
382382
*/
383383
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:
@@ -240,16 +240,16 @@ object Inferencing {
240240
* relationship _necessarily_ must hold.
241241
*
242242
* We accomplish that by:
243-
* - replacing covariant occurences with upper GADT bound
244-
* - replacing contravariant occurences with lower GADT bound
245-
* - leaving invariant occurences alone
243+
* - replacing covariant occurrences with upper GADT bound
244+
* - replacing contravariant occurrences with lower GADT bound
245+
* - leaving invariant occurrences alone
246246
*
247247
* Examples:
248248
* - If we have GADT cstr A <: Int, then for all A <: Int, Option[A] <: Option[Int].
249249
* Therefore, we can approximate Option[A] ~~ Option[Int].
250250
* - If we have A >: S <: T, then for all such A, A => A <: S => T. This
251251
* illustrates that it's fine to differently approximate different
252-
* occurences of same type.
252+
* occurrences of same type.
253253
* - If we have A <: Int and F <: [A] => Option[A] (note the invariance),
254254
* then we should approximate F[A] ~~ Option[A]. That is, we should
255255
* respect the invariance of the type constructor.
@@ -449,7 +449,7 @@ object Inferencing {
449449
* +1 means: only covariant occurrences
450450
* 0 means: mixed or non-variant occurrences
451451
*
452-
* We need to take the occurences in `pt` into account because a type
452+
* We need to take the occurrences in `pt` into account because a type
453453
* variable created when typing the current tree might only appear in the
454454
* bounds of a type variable in the expected type, for example when
455455
* `ConstraintHandling#legalBound` creates type variables when approximating
@@ -564,7 +564,7 @@ trait Inferencing { this: Typer =>
564564
* Eligible for interpolation are all type variables owned by the current typerstate
565565
* that are not in `locked` and whose `nestingLevel` is `>= ctx.nestingLevel`.
566566
* Type variables occurring co- (respectively, contra-) variantly in the tree type
567-
* or expected type are minimized (respectvely, maximized). Non occurring type variables are minimized if they
567+
* or expected type are minimized (respectively, maximized). Non occurring type variables are minimized if they
568568
* have a lower bound different from Nothing, maximized otherwise. Type variables appearing
569569
* non-variantly in the type are left untouched.
570570
*

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ trait TypeAssigner {
126126
val qualType0 = qual1.tpe.widenIfUnstable
127127
val qualType =
128128
if !qualType0.hasSimpleKind && tree.name != nme.CONSTRUCTOR then
129-
// constructors are selected on typeconstructor, type arguments are passed afterwards
129+
// constructors are selected on type constructor, type arguments are passed afterwards
130130
errorType(em"$qualType0 takes type parameters", qual1.srcPos)
131131
else if !qualType0.isInstanceOf[TermType] && !qualType0.isError then
132132
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
@@ -2199,7 +2199,7 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
21992199
// any references to other parameter types of the underlying hk lambda
22002200
// in order not to get orphan parameters. Test case in pos/i15564.scala.
22012201
// Note 1: It would be better to substitute actual arguments for corresponding
2202-
// formal paramaters, but it looks very hard to do this at the point where
2202+
// formal parameters, but it looks very hard to do this at the point where
22032203
// a bound type variable is created.
22042204
// Note 2: If the type constructor is a class type, no sanitization is needed
22052205
// since we can refer to the other paraeters with dependent types C[...]#X.
@@ -3556,7 +3556,7 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
35563556
val app = tryExtMethod(alt)(using nestedCtx)
35573557
(if nestedCtx.reporter.hasErrors then failures else successes)
35583558
+= ((app, nestedCtx.typerState))
3559-
typr.println(i"multiple extensioin methods, success: ${successes.toList}, failure: ${failures.toList}")
3559+
typr.println(i"multiple extension methods, success: ${successes.toList}, failure: ${failures.toList}")
35603560

35613561
def pick(alt: (Tree, TyperState)): Tree =
35623562
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)