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 {

0 commit comments

Comments
 (0)