From 3c06b77d690d166f8fe7a6c50d5c5b88d739bbdb Mon Sep 17 00:00:00 2001 From: Som Snytt Date: Sun, 31 Mar 2024 18:09:42 -0700 Subject: [PATCH] Detabulate files --- compiler/src/dotty/tools/dotc/ast/TreeInfo.scala | 2 +- compiler/src/dotty/tools/dotc/core/Flags.scala | 2 +- .../src/dotty/tools/dotc/core/SymDenotations.scala | 6 +++--- .../src/dotty/tools/dotc/core/SymbolLoaders.scala | 4 ++-- compiler/src/dotty/tools/dotc/core/Types.scala | 6 +++--- .../dotty/tools/dotc/printing/RefinedPrinter.scala | 6 +++--- .../src/dotty/tools/dotc/transform/Bridges.scala | 4 ++-- .../src/dotty/tools/dotc/transform/Erasure.scala | 8 ++++---- .../dotty/tools/dotc/transform/ExplicitOuter.scala | 12 ++++++------ .../src/dotty/tools/dotc/transform/PostTyper.scala | 4 ++-- .../src/dotty/tools/dotc/typer/Applications.scala | 4 ++-- compiler/src/dotty/tools/dotc/typer/Implicits.scala | 6 +++--- compiler/src/dotty/tools/dotc/typer/Typer.scala | 10 +++++----- 13 files changed, 37 insertions(+), 37 deletions(-) diff --git a/compiler/src/dotty/tools/dotc/ast/TreeInfo.scala b/compiler/src/dotty/tools/dotc/ast/TreeInfo.scala index 28d3ef6daaef..a1bba544cc06 100644 --- a/compiler/src/dotty/tools/dotc/ast/TreeInfo.scala +++ b/compiler/src/dotty/tools/dotc/ast/TreeInfo.scala @@ -1105,7 +1105,7 @@ trait TypedTreeInfo extends TreeInfo[Type] { self: Trees.Instance[Type] => case AndType(ref, nn1) if qual.tpe eq ref => qual.tpe.widen match case OrNull(nn2) if nn1 eq nn2 => - Some(qual) + Some(qual) case _ => None case _ => None case _ => None diff --git a/compiler/src/dotty/tools/dotc/core/Flags.scala b/compiler/src/dotty/tools/dotc/core/Flags.scala index 249940d8ff99..1f38289161cd 100644 --- a/compiler/src/dotty/tools/dotc/core/Flags.scala +++ b/compiler/src/dotty/tools/dotc/core/Flags.scala @@ -137,7 +137,7 @@ object Flags { def flagStrings(privateWithin: String = ""): Seq[String] = { var rawStrings = (2 to MaxFlag).flatMap(x.flagString(_)) // DOTTY problem: cannot drop with (_) if (!privateWithin.isEmpty && !x.is(Protected)) - rawStrings = rawStrings :+ "private" + rawStrings :+= "private" val scopeStr = if (x.is(Local)) "this" else privateWithin if (scopeStr != "") rawStrings.filter(_ != "").map { diff --git a/compiler/src/dotty/tools/dotc/core/SymDenotations.scala b/compiler/src/dotty/tools/dotc/core/SymDenotations.scala index 5304c9efadc0..5578028a82c2 100644 --- a/compiler/src/dotty/tools/dotc/core/SymDenotations.scala +++ b/compiler/src/dotty/tools/dotc/core/SymDenotations.scala @@ -772,7 +772,7 @@ object SymDenotations { * This can mean one of two things: * - the method and class are defined in a structural given instance, or * - the class is an implicit class and the method is its implicit conversion. - */ + */ final def isCoDefinedGiven(cls: Symbol)(using Context): Boolean = is(Method) && isOneOf(GivenOrImplicit) && ( is(Synthetic) // previous scheme used in 3.0 @@ -1071,8 +1071,8 @@ object SymDenotations { */ final def moduleClass(using Context): Symbol = { def notFound = { - if (Config.showCompletions) println(s"missing module class for $name: $myInfo") - NoSymbol + if (Config.showCompletions) println(s"missing module class for $name: $myInfo") + NoSymbol } if (this.is(ModuleVal)) myInfo match { diff --git a/compiler/src/dotty/tools/dotc/core/SymbolLoaders.scala b/compiler/src/dotty/tools/dotc/core/SymbolLoaders.scala index 75c610b29140..abdcdd610042 100644 --- a/compiler/src/dotty/tools/dotc/core/SymbolLoaders.scala +++ b/compiler/src/dotty/tools/dotc/core/SymbolLoaders.scala @@ -221,8 +221,8 @@ object SymbolLoaders { Stats.record("package scopes") /** The scope of a package. This is different from a normal scope - * in that names of scope entries are kept in mangled form. - */ + * in that names of scope entries are kept in mangled form. + */ final class PackageScope extends MutableScope(0) { override def newScopeEntry(name: Name, sym: Symbol)(using Context): ScopeEntry = super.newScopeEntry(name.mangled, sym) diff --git a/compiler/src/dotty/tools/dotc/core/Types.scala b/compiler/src/dotty/tools/dotc/core/Types.scala index 62844a54bf48..513e00347251 100644 --- a/compiler/src/dotty/tools/dotc/core/Types.scala +++ b/compiler/src/dotty/tools/dotc/core/Types.scala @@ -1340,7 +1340,7 @@ object Types extends TypeUtils { * * For instance, if `A` is an unconstrained type variable, then * - * ArrayBuffer[Int] | ArrayBuffer[A] + * ArrayBuffer[Int] | ArrayBuffer[A] * * is approximated by constraining `A` to be =:= to `Int` and returning `ArrayBuffer[Int]` * instead of `ArrayBuffer[? >: Int | A <: Int & A]` @@ -3488,7 +3488,7 @@ object Types extends TypeUtils { private var myFactorCount = 0 override def andFactorCount = if myFactorCount == 0 then - myFactorCount = tp1.andFactorCount + tp2.andFactorCount + myFactorCount = tp1.andFactorCount + tp2.andFactorCount myFactorCount def derivedAndType(tp1: Type, tp2: Type)(using Context): Type = @@ -3766,7 +3766,7 @@ object Types extends TypeUtils { * LambdaType | TermLambda | TypeLambda * -------------+-------------------+------------------ * HKLambda | HKTermLambda | HKTypeLambda - * MethodOrPoly | MethodType | PolyType + * MethodOrPoly | MethodType | PolyType */ trait LambdaType extends BindingType with TermType { self => type ThisName <: Name diff --git a/compiler/src/dotty/tools/dotc/printing/RefinedPrinter.scala b/compiler/src/dotty/tools/dotc/printing/RefinedPrinter.scala index 93e280f8a13c..e84cbc7c50d5 100644 --- a/compiler/src/dotty/tools/dotc/printing/RefinedPrinter.scala +++ b/compiler/src/dotty/tools/dotc/printing/RefinedPrinter.scala @@ -478,9 +478,9 @@ class RefinedPrinter(_ctx: Context) extends PlainPrinter(_ctx) { if isWildcardStarArg(tree) then expr match case Ident(nme.WILDCARD_STAR) => - // `_*` is used as a wildcard name to indicate a vararg splice pattern; - // avoid the double `*` in this case. - toText(expr) + // `_*` is used as a wildcard name to indicate a vararg splice pattern; + // avoid the double `*` in this case. + toText(expr) case _ => toText(expr) ~ "*" else diff --git a/compiler/src/dotty/tools/dotc/transform/Bridges.scala b/compiler/src/dotty/tools/dotc/transform/Bridges.scala index 2110ac1464c2..482e5056fad0 100644 --- a/compiler/src/dotty/tools/dotc/transform/Bridges.scala +++ b/compiler/src/dotty/tools/dotc/transform/Bridges.scala @@ -26,8 +26,8 @@ class Bridges(root: ClassSymbol, thisPhase: DenotTransformer)(using Context) { override def isSubParent(parent: Symbol, bc: Symbol)(using Context) = true - // Never consider a bridge if there is a superclass that would contain it - // See run/t2857.scala for a test that would break with a VerifyError otherwise. + // Never consider a bridge if there is a superclass that would contain it + // See run/t2857.scala for a test that would break with a VerifyError otherwise. /** Only use the superclass of `root` as a parent class. This means * overriding pairs that have a common implementation in a trait parent diff --git a/compiler/src/dotty/tools/dotc/transform/Erasure.scala b/compiler/src/dotty/tools/dotc/transform/Erasure.scala index 01fc423b0076..8bfbb90a0700 100644 --- a/compiler/src/dotty/tools/dotc/transform/Erasure.scala +++ b/compiler/src/dotty/tools/dotc/transform/Erasure.scala @@ -594,9 +594,9 @@ object Erasure { def erasedDef(sym: Symbol)(using Context): Tree = if sym.isClass then - // We cannot simply drop erased classes, since then they would not generate classfiles - // and would not be visible under separate compilation. So we transform them to - // empty interfaces instead. + // We cannot simply drop erased classes, since then they would not generate classfiles + // and would not be visible under separate compilation. So we transform them to + // empty interfaces instead. tpd.ClassDef(sym.asClass, DefDef(sym.primaryConstructor.asTerm), Nil) else if sym.owner.isClass then sym.dropAfter(erasurePhase) @@ -667,7 +667,7 @@ object Erasure { */ override def typedSelect(tree: untpd.Select, pt: Type)(using Context): Tree = { if tree.name == nme.apply && integrateSelect(tree) then - return typed(tree.qualifier, pt) + return typed(tree.qualifier, pt) val qual1 = typed(tree.qualifier, AnySelectionProto) diff --git a/compiler/src/dotty/tools/dotc/transform/ExplicitOuter.scala b/compiler/src/dotty/tools/dotc/transform/ExplicitOuter.scala index b976dfaa2f9f..55a692780b85 100644 --- a/compiler/src/dotty/tools/dotc/transform/ExplicitOuter.scala +++ b/compiler/src/dotty/tools/dotc/transform/ExplicitOuter.scala @@ -352,12 +352,12 @@ object ExplicitOuter { case _ => // Need to be careful to dealias before erasure, otherwise we lose prefixes. atPhaseNoLater(erasurePhase)(outerPrefix(tpe.underlying)) - // underlying is fine here and below since we are calling this after erasure. - // However, there is some weird stuff going on with parboiled2 where an - // AppliedType with a type alias as constructor is fed to outerPrefix. - // For some other unknown reason this works with underlying but not with superType. - // I was not able to minimize the problem and parboiled2 spits out way too much - // macro generated code to be able to pinpoint the root problem. + // underlying is fine here and below since we are calling this after erasure. + // However, there is some weird stuff going on with parboiled2 where an + // AppliedType with a type alias as constructor is fed to outerPrefix. + // For some other unknown reason this works with underlying but not with superType. + // I was not able to minimize the problem and parboiled2 spits out way too much + // macro generated code to be able to pinpoint the root problem. } case tpe: TypeProxy => outerPrefix(tpe.underlying) diff --git a/compiler/src/dotty/tools/dotc/transform/PostTyper.scala b/compiler/src/dotty/tools/dotc/transform/PostTyper.scala index 3bcec80b5b10..46f5774e671a 100644 --- a/compiler/src/dotty/tools/dotc/transform/PostTyper.scala +++ b/compiler/src/dotty/tools/dotc/transform/PostTyper.scala @@ -328,8 +328,8 @@ class PostTyper extends MacroTransform with InfoTransformer { thisPhase => else tree def app1 = - // reverse order of transforming args and fun. This way, we get a chance to see other - // well-formedness errors before reporting errors in possible inferred type args of fun. + // reverse order of transforming args and fun. This way, we get a chance to see other + // well-formedness errors before reporting errors in possible inferred type args of fun. val args1 = transform(app.args) cpy.Apply(app)(transform(app.fun), args1) methPart(app) match diff --git a/compiler/src/dotty/tools/dotc/typer/Applications.scala b/compiler/src/dotty/tools/dotc/typer/Applications.scala index 82f4c89ae203..3974dab75461 100644 --- a/compiler/src/dotty/tools/dotc/typer/Applications.scala +++ b/compiler/src/dotty/tools/dotc/typer/Applications.scala @@ -1359,8 +1359,8 @@ trait Applications extends Compatibility { || ctx.reporter.hasErrors then result else notAnExtractor(result) - // It might be that the result of typedExpr is an `apply` selection or implicit conversion. - // Reject in this case. + // It might be that the result of typedExpr is an `apply` selection or implicit conversion. + // Reject in this case. def tryWithTypeArgs(qual: untpd.Tree, targs: List[Tree])(fallBack: (Tree, TyperState) => Tree): Tree = tryEither { diff --git a/compiler/src/dotty/tools/dotc/typer/Implicits.scala b/compiler/src/dotty/tools/dotc/typer/Implicits.scala index 5162b3fed1b9..1a13ee396d19 100644 --- a/compiler/src/dotty/tools/dotc/typer/Implicits.scala +++ b/compiler/src/dotty/tools/dotc/typer/Implicits.scala @@ -411,9 +411,9 @@ object Implicits: /** Search mode to use for possibly avoiding looping givens */ enum SearchMode: case Old, // up to 3.3, old mode w/o protection - CompareWarn, // from 3.4, old mode, warn if new mode would change result - CompareErr, // from 3.5, old mode, error if new mode would change result - New // from future, new mode where looping givens are avoided + CompareWarn, // from 3.4, old mode, warn if new mode would change result + CompareErr, // from 3.5, old mode, error if new mode would change result + New // from future, new mode where looping givens are avoided /** The result of an implicit search */ sealed abstract class SearchResult extends Showable { diff --git a/compiler/src/dotty/tools/dotc/typer/Typer.scala b/compiler/src/dotty/tools/dotc/typer/Typer.scala index 0b05bcd078ff..8b9c144f68e9 100644 --- a/compiler/src/dotty/tools/dotc/typer/Typer.scala +++ b/compiler/src/dotty/tools/dotc/typer/Typer.scala @@ -922,9 +922,9 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer import untpd.* var templ1 = templ def isEligible(tp: Type) = - tp.exists - && !tp.typeSymbol.is(Final) - && (!tp.isTopType || tp.isAnyRef) // Object is the only toplevel class that can be instantiated + tp.exists + && !tp.typeSymbol.is(Final) + && (!tp.isTopType || tp.isAnyRef) // Object is the only toplevel class that can be instantiated if (templ1.parents.isEmpty && isFullyDefined(pt, ForceDegree.flipBottom) && isSkolemFree(pt) && @@ -3006,7 +3006,7 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer /** Translate infix operation expression `l op r` to * - * l.op(r) if `op` is left-associative + * l.op(r) if `op` is left-associative * { val x = l; r.op(x) } if `op` is right-associative call-by-value and `l` is impure, and not in a quote pattern * r.op(l) if `op` is right-associative call-by-name, or `l` is pure, or in a quote pattern * @@ -4381,7 +4381,7 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer case poly: PolyType if !(ctx.mode is Mode.Type) && dummyTreeOfType.unapply(tree).isEmpty => // If we are in a conversion from a TermRef with polymorphic underlying - // type, give up. In this case the typed `null` literal cannot be instantiated. + // type, give up. In this case the typed `null` literal cannot be instantiated. // Test case was but i18695.scala, but it got fixed by a different tweak in #18719. // We leave test for this condition in as a defensive measure in case // it arises somewhere else.