diff --git a/compiler/src/dotty/tools/dotc/ast/Trees.scala b/compiler/src/dotty/tools/dotc/ast/Trees.scala index 54c15b9909fa..2a27cd00fb27 100644 --- a/compiler/src/dotty/tools/dotc/ast/Trees.scala +++ b/compiler/src/dotty/tools/dotc/ast/Trees.scala @@ -763,7 +763,7 @@ object Trees { } /** Tree that replaces a level 1 splices in pickled (level 0) quotes. - * It is only used when picking quotes (will never be in a TASTy file). + * It is only used when pickling quotes (will never be in a TASTy file). * * @param isTerm If this hole is a term, otherwise it is a type hole. * @param idx The index of the hole in it's enclosing level 0 quote. diff --git a/compiler/src/dotty/tools/dotc/core/ConstraintHandling.scala b/compiler/src/dotty/tools/dotc/core/ConstraintHandling.scala index 9ffe2bda73cb..0adf632b03e1 100644 --- a/compiler/src/dotty/tools/dotc/core/ConstraintHandling.scala +++ b/compiler/src/dotty/tools/dotc/core/ConstraintHandling.scala @@ -102,7 +102,7 @@ trait ConstraintHandling { * * If we trust bounds, then the lower bound of `X` is `x.M` since `x.M >: 1`. * Then even if we correct levels on instantiation to eliminate the local `x`, - * it is alreay too late, we'd get `Int & String` as instance, which does not + * it is already too late, we'd get `Int & String` as instance, which does not * satisfy the original constraint `X >: 1`. * * But if `trustBounds` is false, we do not conclude the `x.M >: 1` since @@ -708,8 +708,8 @@ trait ConstraintHandling { // Widening can add extra constraints, in particular the widened type might // be a type variable which is now instantiated to `param`, and therefore // cannot be used as an instantiation of `param` without creating a loop. - // If that happens, we run `instanceType` again to find a new instantation. - // (we do not check for non-toplevel occurences: those should never occur + // If that happens, we run `instanceType` again to find a new instantiation. + // (we do not check for non-toplevel occurrences: those should never occur // since `addOneBound` disallows recursive lower bounds). if constraint.occursAtToplevel(param, widened) then instanceType(param, fromBelow, widenUnions, maxLevel) diff --git a/compiler/src/dotty/tools/dotc/core/Symbols.scala b/compiler/src/dotty/tools/dotc/core/Symbols.scala index 07ac2be90819..7cad8bd0e250 100644 --- a/compiler/src/dotty/tools/dotc/core/Symbols.scala +++ b/compiler/src/dotty/tools/dotc/core/Symbols.scala @@ -77,7 +77,7 @@ object Symbols { /** Does this symbol retain its definition tree? * A good policy for this needs to balance costs and benefits, where - * costs are mainly memoty leaks, in particular across runs. + * costs are mainly memory leaks, in particular across runs. */ def retainsDefTree(using Context): Boolean = ctx.settings.YretainTrees.value || diff --git a/compiler/src/dotty/tools/dotc/core/TypeApplications.scala b/compiler/src/dotty/tools/dotc/core/TypeApplications.scala index 667869947c6e..c1b2541c460b 100644 --- a/compiler/src/dotty/tools/dotc/core/TypeApplications.scala +++ b/compiler/src/dotty/tools/dotc/core/TypeApplications.scala @@ -406,7 +406,7 @@ class TypeApplications(val self: Type) extends AnyVal { if (typeParams.nonEmpty) appliedTo(args) else self /** A cycle-safe version of `appliedTo` where computing type parameters do not force - * the typeconstructor. Instead, if the type constructor is completing, we make + * the type constructor. Instead, if the type constructor is completing, we make * up hk type parameters matching the arguments. This is needed when unpickling * Scala2 files such as `scala.collection.generic.Mapfactory`. */ diff --git a/compiler/src/dotty/tools/dotc/core/TypeComparer.scala b/compiler/src/dotty/tools/dotc/core/TypeComparer.scala index bd5b87800c6b..01709a9cd41d 100644 --- a/compiler/src/dotty/tools/dotc/core/TypeComparer.scala +++ b/compiler/src/dotty/tools/dotc/core/TypeComparer.scala @@ -1751,7 +1751,7 @@ class TypeComparer(@constructorOnly initctx: Context) extends ConstraintHandling * any, or no constraint at all. * * Otherwise, we infer _sufficient_ constraints: we try to keep the smaller of - * the two constraints, but if never is smaller than the other, we just pick + * the two constraints, but if neither is smaller than the other, we just pick * the first one. */ protected def either(op1: => Boolean, op2: => Boolean): Boolean = @@ -1961,7 +1961,7 @@ class TypeComparer(@constructorOnly initctx: Context) extends ConstraintHandling // is that if the refinement does not refer to a member symbol, we will have to // resort to reflection to invoke the member. And Java reflection needs to know exact // erased parameter types. See neg/i12211.scala. Other reflection algorithms could - // conceivably dispatch without knowning precise parameter signatures. One can signal + // conceivably dispatch without knowing precise parameter signatures. One can signal // this by inheriting from the `scala.reflect.SignatureCanBeImprecise` marker trait, // in which case the signature test is elided. def sigsOK(symInfo: Type, info2: Type) = @@ -2785,7 +2785,7 @@ class TypeComparer(@constructorOnly initctx: Context) extends ConstraintHandling else false case (AppliedType(tycon1, args1), AppliedType(tycon2, args2)) if isSame(tycon1, tycon2) => - // It is possible to conclude that two types applies are disjoint by + // It is possible to conclude that two types applied are disjoint by // looking at covariant type parameters if the said type parameters // are disjoin and correspond to fields. // (Type parameter disjointness is not enough by itself as it could diff --git a/compiler/src/dotty/tools/dotc/core/Types.scala b/compiler/src/dotty/tools/dotc/core/Types.scala index f8542dc84e9e..c4d23d1939b8 100644 --- a/compiler/src/dotty/tools/dotc/core/Types.scala +++ b/compiler/src/dotty/tools/dotc/core/Types.scala @@ -3340,7 +3340,7 @@ object Types { def isAnd: Boolean = true private var myBaseClassesPeriod: Period = Nowhere private var myBaseClasses: List[ClassSymbol] = _ - /** Base classes of are the merge of the operand base classes. */ + /** Base classes are the merge of the operand base classes. */ override final def baseClasses(using Context): List[ClassSymbol] = { if (myBaseClassesPeriod != ctx.period) { val bcs1 = tp1.baseClasses @@ -3433,7 +3433,7 @@ object Types { def isSoft: Boolean private var myBaseClassesPeriod: Period = Nowhere private var myBaseClasses: List[ClassSymbol] = _ - /** Base classes of are the intersection of the operand base classes. */ + /** Base classes are the intersection of the operand base classes. */ override final def baseClasses(using Context): List[ClassSymbol] = { if (myBaseClassesPeriod != ctx.period) { val bcs1 = tp1.baseClasses diff --git a/compiler/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala b/compiler/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala index 98bd7152ff37..06fff6d57957 100644 --- a/compiler/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala +++ b/compiler/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala @@ -263,7 +263,7 @@ class TreeUnpickler(reader: TastyReader, /** Read reference to definition and return symbol created at that definition */ def readSymRef()(using Context): Symbol = symbolAt(readAddr()) - /** The symbol at given address; createa new one if none exists yet */ + /** The symbol at given address; create a new one if none exists yet */ def symbolAt(addr: Addr)(using Context): Symbol = symAtAddr.get(addr) match { case Some(sym) => sym diff --git a/compiler/src/dotty/tools/dotc/inlines/Inliner.scala b/compiler/src/dotty/tools/dotc/inlines/Inliner.scala index 73fa2a2871a2..87ef7cb93e76 100644 --- a/compiler/src/dotty/tools/dotc/inlines/Inliner.scala +++ b/compiler/src/dotty/tools/dotc/inlines/Inliner.scala @@ -177,7 +177,7 @@ class Inliner(val call: tpd.Tree)(using Context): /** A map from the classes of (direct and outer) this references in `rhsToInline` * to references of their proxies. * Note that we can't index by the ThisType itself since there are several - * possible forms to express what is logicaly the same ThisType. E.g. + * possible forms to express what is logically the same ThisType. E.g. * * ThisType(TypeRef(ThisType(p), cls)) * @@ -338,7 +338,7 @@ class Inliner(val call: tpd.Tree)(using Context): protected def hasOpaqueProxies = opaqueProxies.nonEmpty - /** Map first halfs of opaqueProxies pairs to second halfs, using =:= as equality */ + /** Map first halves of opaqueProxies pairs to second halves, using =:= as equality */ private def mapRef(ref: TermRef): Option[TermRef] = opaqueProxies.collectFirst { case (from, to) if from.symbol == ref.symbol && from =:= ref => to @@ -1047,13 +1047,13 @@ class Inliner(val call: tpd.Tree)(using Context): val evaluatedSplice = inContext(quoted.MacroExpansion.context(inlinedFrom)) { Splicer.splice(body, splicePos, inlinedFrom.srcPos, MacroClassLoader.fromContext) } - val inlinedNormailizer = new TreeMap { + val inlinedNormalizer = new TreeMap { override def transform(tree: tpd.Tree)(using Context): tpd.Tree = tree match { case Inlined(EmptyTree, Nil, expr) if enclosingInlineds.isEmpty => transform(expr) case _ => super.transform(tree) } } - val normalizedSplice = inlinedNormailizer.transform(evaluatedSplice) + val normalizedSplice = inlinedNormalizer.transform(evaluatedSplice) if (normalizedSplice.isEmpty) normalizedSplice else normalizedSplice.withSpan(splicePos.span) } diff --git a/compiler/src/dotty/tools/dotc/quoted/Interpreter.scala b/compiler/src/dotty/tools/dotc/quoted/Interpreter.scala index c9a77dbfa151..ccf6cd6f995b 100644 --- a/compiler/src/dotty/tools/dotc/quoted/Interpreter.scala +++ b/compiler/src/dotty/tools/dotc/quoted/Interpreter.scala @@ -47,7 +47,7 @@ class Interpreter(pos: SrcPos, classLoader0: ClassLoader)(using Context): /** Returns the result of interpreting the code in the tree. * Return Some of the result or None if the result type is not consistent with the expected type. - * Throws a StopInterpretation if the tree could not be interpreted or a runtime exception ocurred. + * Throws a StopInterpretation if the tree could not be interpreted or a runtime exception occurred. */ final def interpret[T](tree: Tree)(using ct: ClassTag[T]): Option[T] = interpretTree(tree)(using emptyEnv) match { @@ -59,7 +59,7 @@ class Interpreter(pos: SrcPos, classLoader0: ClassLoader)(using Context): } /** Returns the result of interpreting the code in the tree. - * Throws a StopInterpretation if the tree could not be interpreted or a runtime exception ocurred. + * Throws a StopInterpretation if the tree could not be interpreted or a runtime exception occurred. */ protected def interpretTree(tree: Tree)(using Env): Object = tree match { case Literal(Constant(value)) => diff --git a/compiler/src/dotty/tools/dotc/transform/MegaPhase.scala b/compiler/src/dotty/tools/dotc/transform/MegaPhase.scala index b4e8c3acbc5c..ed3532213ad0 100644 --- a/compiler/src/dotty/tools/dotc/transform/MegaPhase.scala +++ b/compiler/src/dotty/tools/dotc/transform/MegaPhase.scala @@ -26,7 +26,7 @@ object MegaPhase { * * - Stats: to prepare/transform a statement sequence in a block, template, or package def, * - Unit : to prepare/transform a whole compilation unit - * - Other: to prepape/transform a tree that does not have a specific prepare/transform + * - Other: to prepare/transform a tree that does not have a specific prepare/transform * method pair. */ abstract class MiniPhase extends Phase { diff --git a/compiler/src/dotty/tools/dotc/transform/Recheck.scala b/compiler/src/dotty/tools/dotc/transform/Recheck.scala index 527c73d02250..0c0b20025562 100644 --- a/compiler/src/dotty/tools/dotc/transform/Recheck.scala +++ b/compiler/src/dotty/tools/dotc/transform/Recheck.scala @@ -497,7 +497,7 @@ abstract class Recheck extends Phase, SymTransformer: throw ex } - /** Typing and previous transforms sometiems leaves skolem types in prefixes of + /** Typing and previous transforms sometimes leaves skolem types in prefixes of * NamedTypes in `expected` that do not match the `actual` Type. -Ycheck does * not complain (need to find out why), but a full recheck does. We compensate * by de-skolemizing everywhere in `expected` except when variance is negative. diff --git a/compiler/src/dotty/tools/dotc/transform/SpecializeFunctions.scala b/compiler/src/dotty/tools/dotc/transform/SpecializeFunctions.scala index 2248fbc8d570..c50eaddd3213 100644 --- a/compiler/src/dotty/tools/dotc/transform/SpecializeFunctions.scala +++ b/compiler/src/dotty/tools/dotc/transform/SpecializeFunctions.scala @@ -85,7 +85,7 @@ class SpecializeFunctions extends MiniPhase { case Select(qual, _) => val qual1 = qual.tpe.widen match case defn.ByNameFunction(res) => - // Need to cast to regular function, since specialied apply methods + // Need to cast to regular function, since specialized apply methods // are not members of ContextFunction0. The cast will be eliminated in // erasure. qual.cast(defn.FunctionOf(Nil, res)) diff --git a/compiler/src/dotty/tools/dotc/transform/SymUtils.scala b/compiler/src/dotty/tools/dotc/transform/SymUtils.scala index 3fe05a45699e..3b5b8c77175e 100644 --- a/compiler/src/dotty/tools/dotc/transform/SymUtils.scala +++ b/compiler/src/dotty/tools/dotc/transform/SymUtils.scala @@ -101,7 +101,7 @@ object SymUtils: else if (self.is(Abstract)) "it is an abstract class" else if (self.primaryConstructor.info.paramInfoss.length != 1) "it takes more than one parameter list" else if (isDerivedValueClass(self)) "it is a value class" - else if (!(companionMirror || canAccessCtor)) s"the constructor of $self is innaccessible from the calling scope." + else if (!(companionMirror || canAccessCtor)) s"the constructor of $self is inaccessible from the calling scope." else "" end whyNotGenericProduct diff --git a/compiler/src/dotty/tools/dotc/transform/patmat/Space.scala b/compiler/src/dotty/tools/dotc/transform/patmat/Space.scala index eab65890c227..bc9e5158f14b 100644 --- a/compiler/src/dotty/tools/dotc/transform/patmat/Space.scala +++ b/compiler/src/dotty/tools/dotc/transform/patmat/Space.scala @@ -444,7 +444,7 @@ object SpaceEngine { * * We cannot use type erasure here, as it would lose the constraints * involving GADTs. For example, in the following code, type - * erasure would loose the constraint that `x` and `y` must be + * erasure would lose the constraint that `x` and `y` must be * the same type, resulting in false inexhaustive warnings: * * sealed trait Expr[T] diff --git a/compiler/src/dotty/tools/dotc/typer/Checking.scala b/compiler/src/dotty/tools/dotc/typer/Checking.scala index df5639b50302..061266014615 100644 --- a/compiler/src/dotty/tools/dotc/typer/Checking.scala +++ b/compiler/src/dotty/tools/dotc/typer/Checking.scala @@ -371,7 +371,7 @@ object Checking { /** Check that `info` of symbol `sym` is not cyclic. * @pre sym is not yet initialized (i.e. its type is a Completer). - * @return `info` where every legal F-bounded reference is proctected + * @return `info` where every legal F-bounded reference is protected * by a `LazyRef`, or `ErrorType` if a cycle was detected and reported. */ def checkNonCyclic(sym: Symbol, info: Type, reportErrors: Boolean)(using Context): Type = { diff --git a/compiler/src/dotty/tools/dotc/typer/Inferencing.scala b/compiler/src/dotty/tools/dotc/typer/Inferencing.scala index 4d027b8750e0..f62885647bae 100644 --- a/compiler/src/dotty/tools/dotc/typer/Inferencing.scala +++ b/compiler/src/dotty/tools/dotc/typer/Inferencing.scala @@ -141,7 +141,7 @@ object Inferencing { * 3. T is minimized if it has a lower bound (different from Nothing) in the * current constraint (the bound might come from T's declaration). * 4. Otherwise, T is maximized if it has an upper bound (different from Any) - * in the currented constraint (the bound might come from T's declaration). + * in the current constraint (the bound might come from T's declaration). * 5. Otherwise, T is not instantiated at all. * If (1) and (2) do not apply, and minimizeSelected is not set: @@ -244,16 +244,16 @@ object Inferencing { * relationship _necessarily_ must hold. * * We accomplish that by: - * - replacing covariant occurences with upper GADT bound - * - replacing contravariant occurences with lower GADT bound - * - leaving invariant occurences alone + * - replacing covariant occurrences with upper GADT bound + * - replacing contravariant occurrences with lower GADT bound + * - leaving invariant occurrences alone * * Examples: * - If we have GADT cstr A <: Int, then for all A <: Int, Option[A] <: Option[Int]. * Therefore, we can approximate Option[A] ~~ Option[Int]. * - If we have A >: S <: T, then for all such A, A => A <: S => T. This * illustrates that it's fine to differently approximate different - * occurences of same type. + * occurrences of same type. * - If we have A <: Int and F <: [A] => Option[A] (note the invariance), * then we should approximate F[A] ~~ Option[A]. That is, we should * respect the invariance of the type constructor. @@ -453,7 +453,7 @@ object Inferencing { * +1 means: only covariant occurrences * 0 means: mixed or non-variant occurrences * - * We need to take the occurences in `pt` into account because a type + * We need to take the occurrences in `pt` into account because a type * variable created when typing the current tree might only appear in the * bounds of a type variable in the expected type, for example when * `ConstraintHandling#legalBound` creates type variables when approximating @@ -568,7 +568,7 @@ trait Inferencing { this: Typer => * Eligible for interpolation are all type variables owned by the current typerstate * that are not in `locked` and whose `nestingLevel` is `>= ctx.nestingLevel`. * Type variables occurring co- (respectively, contra-) variantly in the tree type - * or expected type are minimized (respectvely, maximized). Non occurring type variables are minimized if they + * or expected type are minimized (respectively, maximized). Non occurring type variables are minimized if they * have a lower bound different from Nothing, maximized otherwise. Type variables appearing * non-variantly in the type are left untouched. * diff --git a/compiler/src/dotty/tools/dotc/typer/TypeAssigner.scala b/compiler/src/dotty/tools/dotc/typer/TypeAssigner.scala index be6121e13209..4a81e6ff017d 100644 --- a/compiler/src/dotty/tools/dotc/typer/TypeAssigner.scala +++ b/compiler/src/dotty/tools/dotc/typer/TypeAssigner.scala @@ -122,7 +122,7 @@ trait TypeAssigner { val qualType0 = qual1.tpe.widenIfUnstable val qualType = if !qualType0.hasSimpleKind && tree.name != nme.CONSTRUCTOR then - // constructors are selected on typeconstructor, type arguments are passed afterwards + // constructors are selected on type constructor, type arguments are passed afterwards errorType(em"$qualType0 takes type parameters", qual1.srcPos) else if !qualType0.isInstanceOf[TermType] && !qualType0.isError then errorType(em"$qualType0 is illegal as a selection prefix", qual1.srcPos) diff --git a/compiler/src/dotty/tools/dotc/typer/Typer.scala b/compiler/src/dotty/tools/dotc/typer/Typer.scala index 8b6943dba01e..fe191a0a5f6b 100644 --- a/compiler/src/dotty/tools/dotc/typer/Typer.scala +++ b/compiler/src/dotty/tools/dotc/typer/Typer.scala @@ -2138,7 +2138,7 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer // any references to other parameter types of the underlying hk lambda // in order not to get orphan parameters. Test case in pos/i15564.scala. // Note 1: It would be better to substitute actual arguments for corresponding - // formal paramaters, but it looks very hard to do this at the point where + // formal parameters, but it looks very hard to do this at the point where // a bound type variable is created. // Note 2: If the type constructor is a class type, no sanitization is needed // 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 val app = tryExtMethod(alt)(using nestedCtx) (if nestedCtx.reporter.hasErrors then failures else successes) += ((app, nestedCtx.typerState)) - typr.println(i"multiple extensioin methods, success: ${successes.toList}, failure: ${failures.toList}") + typr.println(i"multiple extension methods, success: ${successes.toList}, failure: ${failures.toList}") def pick(alt: (Tree, TyperState)): Tree = val (app, ts) = alt diff --git a/dist/bin/common.bat b/dist/bin/common.bat index 9f47198e757b..7aef606d5509 100644 --- a/dist/bin/common.bat +++ b/dist/bin/common.bat @@ -13,7 +13,7 @@ if defined JAVACMD ( set __JAVA_BIN_DIR= for /f "delims=" %%i in ('where /f java.exe') do ( set "__PATH=%%~dpi" - @rem we take first occurence and ignore Oracle path for java executable + @rem we take first occurrence and ignore Oracle path for java executable if not defined __JAVA_BIN_DIR if "!__PATH!"=="!__PATH:javapath=!" set "__JAVA_BIN_DIR=!__PATH!" ) if defined __JAVA_BIN_DIR set "_JAVACMD=!__JAVA_BIN_DIR!\java.exe" diff --git a/docs/_docs/reference/dropped-features/existential-types.md b/docs/_docs/reference/dropped-features/existential-types.md index 6ef815152cd0..a7c491dfb3b3 100644 --- a/docs/_docs/reference/dropped-features/existential-types.md +++ b/docs/_docs/reference/dropped-features/existential-types.md @@ -10,7 +10,7 @@ have been dropped. The reasons for dropping them are: - Existential types violate a type soundness principle on which DOT and Scala 3 are constructed. That principle says that every - prefix (`p`, respectvely `S`) of a type selection `p.T` or `S#T` + prefix (`p`, respectively `S`) of a type selection `p.T` or `S#T` must either come from a value constructed at runtime or refer to a type that is known to have only good bounds. diff --git a/docs/_docs/reference/metaprogramming/compiletime-ops.md b/docs/_docs/reference/metaprogramming/compiletime-ops.md index 038935badc0b..048c6b6165bb 100644 --- a/docs/_docs/reference/metaprogramming/compiletime-ops.md +++ b/docs/_docs/reference/metaprogramming/compiletime-ops.md @@ -30,7 +30,7 @@ enabling us to handle situations where a value is not present. Note that `S` is the type of the successor of some singleton type. For example the type `S[1]` is the singleton type `2`. -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])`. +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])`. ### `erasedValue` diff --git a/docs/_spec/APPLIEDreference/dropped-features/existential-types.md b/docs/_spec/APPLIEDreference/dropped-features/existential-types.md index 6ef815152cd0..a7c491dfb3b3 100644 --- a/docs/_spec/APPLIEDreference/dropped-features/existential-types.md +++ b/docs/_spec/APPLIEDreference/dropped-features/existential-types.md @@ -10,7 +10,7 @@ have been dropped. The reasons for dropping them are: - Existential types violate a type soundness principle on which DOT and Scala 3 are constructed. That principle says that every - prefix (`p`, respectvely `S`) of a type selection `p.T` or `S#T` + prefix (`p`, respectively `S`) of a type selection `p.T` or `S#T` must either come from a value constructed at runtime or refer to a type that is known to have only good bounds. diff --git a/presentation-compiler/src/main/dotty/tools/pc/PcCollector.scala b/presentation-compiler/src/main/dotty/tools/pc/PcCollector.scala index 7b9cf7acd4a7..d8c68c6c49c8 100644 --- a/presentation-compiler/src/main/dotty/tools/pc/PcCollector.scala +++ b/presentation-compiler/src/main/dotty/tools/pc/PcCollector.scala @@ -273,10 +273,10 @@ abstract class PcCollector[T]( for extensionMethodScope <- extensionMethods - occurence <- collectParams(extensionMethodScope) + occurrence <- collectParams(extensionMethodScope) symbols <- collectAllExtensionParamSymbols( path.headOption.getOrElse(unit.tpdTree), - occurence + occurrence ) yield symbols end seekInExtensionParameters @@ -374,7 +374,7 @@ abstract class PcCollector[T]( soughtFilter: (Symbol => Boolean) => Boolean ): Set[T] = def collectNamesWithParent( - occurences: Set[T], + occurrences: Set[T], tree: Tree, parent: Option[Tree] ): Set[T] = @@ -393,17 +393,17 @@ abstract class PcCollector[T]( // symbols will differ for params in different ext methods, but source pos will be the same if soughtFilter(_.sourcePos == ident.symbol.sourcePos) then - occurences + collect( + occurrences + collect( ident, ident.sourcePos ) - else occurences + else occurrences /** * All select statements such as: * val a = hello.<> */ case sel: Select if sel.span.isCorrect && filter(sel) => - occurences + collect( + occurrences + collect( sel, pos.withSpan(selectNameSpan(sel)) ) @@ -421,7 +421,7 @@ abstract class PcCollector[T]( collectNamesWithParent ) annots.foldLeft( - occurences + collect( + occurrences + collect( df, pos.withSpan(df.nameSpan) ) @@ -462,7 +462,7 @@ abstract class PcCollector[T]( sym ) } - occurences ++ named + occurrences ++ named /** * For traversing annotations: @@ -475,7 +475,7 @@ abstract class PcCollector[T]( new PcCollector.DeepFolderWithParent[Set[T]]( collectNamesWithParent ) - trees.foldLeft(occurences) { case (set, tree) => + trees.foldLeft(occurrences) { case (set, tree) => traverser(set, tree) } /** @@ -512,18 +512,18 @@ abstract class PcCollector[T]( } } .flatten - .toSet ++ occurences + .toSet ++ occurrences case inl: Inlined => val traverser = new PcCollector.DeepFolderWithParent[Set[T]]( collectNamesWithParent ) val trees = inl.call :: inl.bindings - trees.foldLeft(occurences) { case (set, tree) => + trees.foldLeft(occurrences) { case (set, tree) => traverser(set, tree) } case o => - occurences + occurrences end match end collectNamesWithParent diff --git a/presentation-compiler/src/main/dotty/tools/pc/PcInlineValueProviderImpl.scala b/presentation-compiler/src/main/dotty/tools/pc/PcInlineValueProviderImpl.scala index 2c140b47f1e9..afb858ab3242 100644 --- a/presentation-compiler/src/main/dotty/tools/pc/PcInlineValueProviderImpl.scala +++ b/presentation-compiler/src/main/dotty/tools/pc/PcInlineValueProviderImpl.scala @@ -158,9 +158,9 @@ final class PcInlineValueProviderImpl( symbols: List[Symbol] ): Either[String, List[Reference]] = val newctx = driver.currentCtx.fresh.setCompilationUnit(unit) - def buildRef(occurence: Occurence): Either[String, Reference] = + def buildRef(occurrence: Occurence): Either[String, Reference] = val path = - Interactive.pathTo(unit.tpdTree, occurence.pos.span)(using newctx) + Interactive.pathTo(unit.tpdTree, occurrence.pos.span)(using newctx) val indexedContext = IndexedContext( Interactive.contextOfPath(path)(using newctx) ) @@ -175,11 +175,11 @@ final class PcInlineValueProviderImpl( if conflictingSymbols.isEmpty then Right( Reference( - occurence.pos.toLsp, - occurence.parent.map(p => + occurrence.pos.toLsp, + occurrence.parent.map(p => RangeOffset(p.sourcePos.start, p.sourcePos.end) ), - occurence.parent + occurrence.parent .map(p => referenceRequiresBrackets(p)(using newctx)) .getOrElse(false) ) diff --git a/scaladoc/src/dotty/tools/scaladoc/QuickLink.scala b/scaladoc/src/dotty/tools/scaladoc/QuickLink.scala index 77ee9916885a..04bc9d59cde3 100644 --- a/scaladoc/src/dotty/tools/scaladoc/QuickLink.scala +++ b/scaladoc/src/dotty/tools/scaladoc/QuickLink.scala @@ -7,7 +7,7 @@ object QuickLink: def usage: String = """List of quick links that is displayed in the header of documentation. |The setting accepts list of quick links in format: text::url - |The first `::` occurence is taken as the delimiter.""".stripMargin + |The first `::` occurrence is taken as the delimiter.""".stripMargin def parse(s: String): Either[String, QuickLink] = s.split(delimiter, 2).toList match case text :: url :: Nil => Right(QuickLink(text, url)) diff --git a/scaladoc/test/dotty/tools/scaladoc/signatures/TranslatableSignaturesTestCases.scala b/scaladoc/test/dotty/tools/scaladoc/signatures/TranslatableSignaturesTestCases.scala index 63d6c897ad38..5067bf5974ca 100644 --- a/scaladoc/test/dotty/tools/scaladoc/signatures/TranslatableSignaturesTestCases.scala +++ b/scaladoc/test/dotty/tools/scaladoc/signatures/TranslatableSignaturesTestCases.scala @@ -1,6 +1,6 @@ package dotty.tools.scaladoc.signatures -class GenericSignaftures extends SignatureTest("genericSignatures", Seq("class")) +class GenericSignatures extends SignatureTest("genericSignatures", Seq("class")) class ObjectSignatures extends SignatureTest("objectSignatures", Seq("object")) diff --git a/tests/neg/i14432.check b/tests/neg/i14432.check index 0778e3841a78..d649987555fd 100644 --- a/tests/neg/i14432.check +++ b/tests/neg/i14432.check @@ -2,5 +2,5 @@ 13 |val mFoo = summon[Mirror.Of[Foo]] // error: no mirror found | ^ |No given instance of type scala.deriving.Mirror.Of[example.Foo] was found for parameter x of method summon in object Predef. Failed to synthesize an instance of type scala.deriving.Mirror.Of[example.Foo]: - | * class Foo is not a generic product because the constructor of class Foo is innaccessible from the calling scope. + | * class Foo is not a generic product because the constructor of class Foo is inaccessible from the calling scope. | * class Foo is not a generic sum because it is not a sealed class diff --git a/tests/neg/i14432a.check b/tests/neg/i14432a.check index e3d154fda4aa..c417dec20bb9 100644 --- a/tests/neg/i14432a.check +++ b/tests/neg/i14432a.check @@ -2,5 +2,5 @@ 14 | val mFoo = summon[Mirror.Of[example.Foo]] // error: no mirror found | ^ |No given instance of type scala.deriving.Mirror.Of[example.Foo] was found for parameter x of method summon in object Predef. Failed to synthesize an instance of type scala.deriving.Mirror.Of[example.Foo]: - | * class Foo is not a generic product because the constructor of class Foo is innaccessible from the calling scope. + | * class Foo is not a generic product because the constructor of class Foo is inaccessible from the calling scope. | * class Foo is not a generic sum because it is not a sealed class diff --git a/tests/neg/i14432b.check b/tests/neg/i14432b.check index 54fcbc62c419..2d5ac3f997eb 100644 --- a/tests/neg/i14432b.check +++ b/tests/neg/i14432b.check @@ -2,5 +2,5 @@ 15 | val mFoo = summon[Mirror.Of[example.Foo]] // error: no mirror found | ^ |No given instance of type scala.deriving.Mirror.Of[example.Foo] was found for parameter x of method summon in object Predef. Failed to synthesize an instance of type scala.deriving.Mirror.Of[example.Foo]: - | * class Foo is not a generic product because the constructor of class Foo is innaccessible from the calling scope. + | * class Foo is not a generic product because the constructor of class Foo is inaccessible from the calling scope. | * class Foo is not a generic sum because it is not a sealed class diff --git a/tests/neg/i14432c.check b/tests/neg/i14432c.check index 7c7861dfa500..c0f69a1095d7 100644 --- a/tests/neg/i14432c.check +++ b/tests/neg/i14432c.check @@ -6,5 +6,5 @@ 16 | val mFoo = summon[Mirror.Of[example.Foo]] // error: no mirror | ^ |No given instance of type scala.deriving.Mirror.Of[example.Foo] was found for parameter x of method summon in object Predef. Failed to synthesize an instance of type scala.deriving.Mirror.Of[example.Foo]: - | * class Foo is not a generic product because the constructor of class Foo is innaccessible from the calling scope. + | * class Foo is not a generic product because the constructor of class Foo is inaccessible from the calling scope. | * class Foo is not a generic sum because it is not a sealed class diff --git a/tests/neg/i14432d.check b/tests/neg/i14432d.check index e7e4f68ba6ec..e0837bb584e2 100644 --- a/tests/neg/i14432d.check +++ b/tests/neg/i14432d.check @@ -2,5 +2,5 @@ 17 | val mFoo = summon[Mirror.Of[example.Foo]] // error | ^ |No given instance of type scala.deriving.Mirror.Of[example.Foo] was found for parameter x of method summon in object Predef. Failed to synthesize an instance of type scala.deriving.Mirror.Of[example.Foo]: - | * class Foo is not a generic product because the constructor of class Foo is innaccessible from the calling scope. + | * class Foo is not a generic product because the constructor of class Foo is inaccessible from the calling scope. | * class Foo is not a generic sum because it is not a sealed class diff --git a/tests/pos-with-compiler-cc/dotc/core/ConstraintHandling.scala b/tests/pos-with-compiler-cc/dotc/core/ConstraintHandling.scala index 8bf671931260..96e965903010 100644 --- a/tests/pos-with-compiler-cc/dotc/core/ConstraintHandling.scala +++ b/tests/pos-with-compiler-cc/dotc/core/ConstraintHandling.scala @@ -707,7 +707,7 @@ trait ConstraintHandling { // be a type variable which is now instantiated to `param`, and therefore // cannot be used as an instantiation of `param` without creating a loop. // If that happens, we run `instanceType` again to find a new instantation. - // (we do not check for non-toplevel occurences: those should never occur + // (we do not check for non-toplevel occurrences: those should never occur // since `addOneBound` disallows recursive lower bounds). if constraint.occursAtToplevel(param, widened) then instanceType(param, fromBelow, widenUnions, maxLevel) diff --git a/tests/pos-with-compiler-cc/dotc/typer/Checking.scala b/tests/pos-with-compiler-cc/dotc/typer/Checking.scala index c0756508ffff..ec7bd6f8abc9 100644 --- a/tests/pos-with-compiler-cc/dotc/typer/Checking.scala +++ b/tests/pos-with-compiler-cc/dotc/typer/Checking.scala @@ -371,7 +371,7 @@ object Checking { /** Check that `info` of symbol `sym` is not cyclic. * @pre sym is not yet initialized (i.e. its type is a Completer). - * @return `info` where every legal F-bounded reference is proctected + * @return `info` where every legal F-bounded reference is protected * by a `LazyRef`, or `ErrorType` if a cycle was detected and reported. */ def checkNonCyclic(sym: Symbol, info: Type, reportErrors: Boolean)(using Context): Type = { diff --git a/tests/pos-with-compiler-cc/dotc/typer/Inferencing.scala b/tests/pos-with-compiler-cc/dotc/typer/Inferencing.scala index cbf30dd97db9..94a4d6f3e71c 100644 --- a/tests/pos-with-compiler-cc/dotc/typer/Inferencing.scala +++ b/tests/pos-with-compiler-cc/dotc/typer/Inferencing.scala @@ -241,16 +241,16 @@ object Inferencing { * relationship _necessarily_ must hold. * * We accomplish that by: - * - replacing covariant occurences with upper GADT bound - * - replacing contravariant occurences with lower GADT bound - * - leaving invariant occurences alone + * - replacing covariant occurrences with upper GADT bound + * - replacing contravariant occurrences with lower GADT bound + * - leaving invariant occurrences alone * * Examples: * - If we have GADT cstr A <: Int, then for all A <: Int, Option[A] <: Option[Int]. * Therefore, we can approximate Option[A] ~~ Option[Int]. * - If we have A >: S <: T, then for all such A, A => A <: S => T. This * illustrates that it's fine to differently approximate different - * occurences of same type. + * occurrences of same type. * - If we have A <: Int and F <: [A] => Option[A] (note the invariance), * then we should approximate F[A] ~~ Option[A]. That is, we should * respect the invariance of the type constructor. @@ -449,7 +449,7 @@ object Inferencing { * +1 means: only covariant occurrences * 0 means: mixed or non-variant occurrences * - * We need to take the occurences in `pt` into account because a type + * We need to take the occurrences in `pt` into account because a type * variable created when typing the current tree might only appear in the * bounds of a type variable in the expected type, for example when * `ConstraintHandling#legalBound` creates type variables when approximating diff --git a/tests/pos-with-compiler/tasty/test-definitions.scala b/tests/pos-with-compiler/tasty/test-definitions.scala index 7bbeeda2083a..f2b6232a8d5e 100644 --- a/tests/pos-with-compiler/tasty/test-definitions.scala +++ b/tests/pos-with-compiler/tasty/test-definitions.scala @@ -244,7 +244,7 @@ object definitions { def isStatic: Boolean // mapped to static Java member def isObject: Boolean // an object or its class (used for a ValDef or a ClassDef extends Modifier respectively) def isTrait: Boolean // a trait (used for a ClassDef) - def isLocal: Boolean // used in conjunction with Private/private[Type] to mean private[this] extends Modifier proctected[this] + def isLocal: Boolean // used in conjunction with Private/private[Type] to mean private[this] extends Modifier protected[this] def isSynthetic: Boolean // generated by Scala compiler def isArtifact: Boolean // to be tagged Java Synthetic def isMutable: Boolean // when used on a ValDef: a var