Skip to content

Commit 9ffd44e

Browse files
Fix assorted typos (#18205)
that I've spotted over the past couple years
2 parents 967aefc + 5836f40 commit 9ffd44e

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 {

0 commit comments

Comments
 (0)