Skip to content

Commit

Permalink
Backport "Detabulate files" to LTS (#21030)
Browse files Browse the repository at this point in the history
Backports #20055 to the LTS branch.

PR submitted by the release tooling.
[skip ci]
  • Loading branch information
WojciechMazur authored Jul 5, 2024
2 parents 71f3a32 + 7e7aa50 commit 6b65b30
Show file tree
Hide file tree
Showing 12 changed files with 34 additions and 34 deletions.
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 @@ -1058,7 +1058,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 @@ -771,7 +771,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 @@ -1067,8 +1067,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 @@ -216,8 +216,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 @@ -1310,7 +1310,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 @@ -3375,7 +3375,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 @@ -3650,7 +3650,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 @@ -470,9 +470,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 @@ -591,9 +591,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 @@ -664,7 +664,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 @@ -319,8 +319,8 @@ class PostTyper extends MacroTransform with IdentityDenotTransformer { 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 @@ -1341,8 +1341,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
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 @@ -900,9 +900,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 @@ -2936,7 +2936,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 @@ -4310,7 +4310,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

0 comments on commit 6b65b30

Please sign in to comment.