Skip to content

Detabulate files #20055

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/ast/TreeInfo.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/core/Flags.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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(_ != "<local>").map {
Expand Down
6 changes: 3 additions & 3 deletions compiler/src/dotty/tools/dotc/core/SymDenotations.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions compiler/src/dotty/tools/dotc/core/SymbolLoaders.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions compiler/src/dotty/tools/dotc/core/Types.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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]`
Expand Down Expand Up @@ -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 =
Expand Down Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions compiler/src/dotty/tools/dotc/printing/RefinedPrinter.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions compiler/src/dotty/tools/dotc/transform/Bridges.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions compiler/src/dotty/tools/dotc/transform/Erasure.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)

Expand Down
12 changes: 6 additions & 6 deletions compiler/src/dotty/tools/dotc/transform/ExplicitOuter.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions compiler/src/dotty/tools/dotc/transform/PostTyper.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions compiler/src/dotty/tools/dotc/typer/Applications.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
6 changes: 3 additions & 3 deletions compiler/src/dotty/tools/dotc/typer/Implicits.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
10 changes: 5 additions & 5 deletions compiler/src/dotty/tools/dotc/typer/Typer.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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) &&
Expand Down Expand Up @@ -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
*
Expand Down Expand Up @@ -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.
Expand Down