Skip to content

Commit a3b7ed6

Browse files
authored
Merge pull request #11213 from dotty-staging/revert-with
Revert to original indentation syntax
2 parents c413ea2 + 945ff14 commit a3b7ed6

File tree

450 files changed

+1319
-1472
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

450 files changed

+1319
-1472
lines changed

community-build/test/scala/dotty/communitybuild/CommunityBuildTest.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import org.junit.{Ignore, Test}
77
import org.junit.Assert.{assertEquals, fail}
88
import org.junit.experimental.categories.Category
99

10-
abstract class CommunityBuildTest with
10+
abstract class CommunityBuildTest:
1111
given CommunityBuildTest = this
1212

1313
/** Depending on the mode of operation, either
@@ -81,7 +81,7 @@ abstract class CommunityBuildTest with
8181
end CommunityBuildTest
8282

8383
@Category(Array(classOf[TestCategory]))
84-
class CommunityBuildTestA extends CommunityBuildTest with
84+
class CommunityBuildTestA extends CommunityBuildTest:
8585
@Test def endpoints4s = projects.endpoints4s.run()
8686
@Test def fansi = projects.fansi.run()
8787
@Test def fastparse = projects.fastparse.run()
@@ -119,7 +119,7 @@ class CommunityBuildTestA extends CommunityBuildTest with
119119
end CommunityBuildTestA
120120

121121
@Category(Array(classOf[TestCategory]))
122-
class CommunityBuildTestB extends CommunityBuildTest with
122+
class CommunityBuildTestB extends CommunityBuildTest:
123123
@Test def algebra = projects.algebra.run()
124124
@Test def betterfiles = projects.betterfiles.run()
125125
@Test def cats = projects.cats.run()

compiler/src/dotty/tools/dotc/Bench.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import scala.annotation.internal.sharable
1111
* number of compilers and run each (sequentially) a given number of times
1212
* on the same sources.
1313
*/
14-
object Bench extends Driver with
14+
object Bench extends Driver:
1515

1616
@sharable private var numRuns = 1
1717

compiler/src/dotty/tools/dotc/ast/DesugarEnums.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ object DesugarEnums {
2020
val Simple, Object, Class: Value = Value
2121
}
2222

23-
final case class EnumConstraints(minKind: CaseKind.Value, maxKind: CaseKind.Value, enumCases: List[(Int, RefTree)]) with
23+
final case class EnumConstraints(minKind: CaseKind.Value, maxKind: CaseKind.Value, enumCases: List[(Int, RefTree)]):
2424
require(minKind <= maxKind && !(cached && enumCases.isEmpty))
2525
def requiresCreator = minKind == CaseKind.Simple
2626
def isEnumeration = maxKind < CaseKind.Class

compiler/src/dotty/tools/dotc/ast/TreeInfo.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -943,7 +943,7 @@ trait TypedTreeInfo extends TreeInfo[Type] { self: Trees.Instance[Type] =>
943943
/** Extractor for not-null assertions.
944944
* A not-null assertion for reference `x` has the form `x.$asInstanceOf$[x.type & T]`.
945945
*/
946-
object AssertNotNull with
946+
object AssertNotNull :
947947
def apply(tree: tpd.Tree, tpnn: Type)(using Context): tpd.Tree =
948948
tree.select(defn.Any_typeCast).appliedToType(AndType(tree.tpe, tpnn))
949949

compiler/src/dotty/tools/dotc/ast/Trees.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ object Trees {
382382
def rhs(using Context): Tree[T] = forceIfLazy
383383
}
384384

385-
trait ValOrTypeDef[-T >: Untyped] extends MemberDef[T] with
385+
trait ValOrTypeDef[-T >: Untyped] extends MemberDef[T]:
386386
type ThisTree[-T >: Untyped] <: ValOrTypeDef[T]
387387

388388
type ParamClause[T >: Untyped] = List[ValDef[T]] | List[TypeDef[T]]
@@ -444,7 +444,7 @@ object Trees {
444444
}
445445

446446
/** The kind of application */
447-
enum ApplyKind with
447+
enum ApplyKind:
448448
case Regular // r.f(x)
449449
case Using // r.f(using x)
450450
case InfixTuple // r f (x1, ..., xN) where N != 1; needs to be treated specially for an error message in typedApply
@@ -1591,12 +1591,12 @@ object Trees {
15911591
}
15921592
}.asInstanceOf[tree.ThisTree[T]]
15931593

1594-
object TypeDefs with
1594+
object TypeDefs:
15951595
def unapply(xs: List[Tree]): Option[List[TypeDef]] = xs match
15961596
case (x: TypeDef) :: _ => Some(xs.asInstanceOf[List[TypeDef]])
15971597
case _ => None
15981598

1599-
object ValDefs with
1599+
object ValDefs:
16001600
def unapply(xs: List[Tree]): Option[List[ValDef]] = xs match
16011601
case Nil => Some(Nil)
16021602
case (x: ValDef) :: _ => Some(xs.asInstanceOf[List[ValDef]])

compiler/src/dotty/tools/dotc/ast/tpd.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1230,12 +1230,12 @@ object tpd extends Trees.Instance[Type] with TypedTreeInfo {
12301230
Ident(defn.ScalaRuntimeModule.requiredMethod(name).termRef).appliedToTermArgs(args)
12311231

12321232
/** An extractor that pulls out type arguments */
1233-
object MaybePoly with
1233+
object MaybePoly:
12341234
def unapply(tree: Tree): Option[(Tree, List[Tree])] = tree match
12351235
case TypeApply(tree, targs) => Some(tree, targs)
12361236
case _ => Some(tree, Nil)
12371237

1238-
object TypeArgs with
1238+
object TypeArgs:
12391239
def unapply(ts: List[Tree]): Option[List[Tree]] =
12401240
if ts.nonEmpty && ts.head.isType then Some(ts) else None
12411241

compiler/src/dotty/tools/dotc/ast/untpd.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ object untpd extends Trees.Instance[Untyped] with UntypedTreeInfo {
155155
}
156156

157157
def WildcardTypeBoundsTree()(using src: SourceFile): TypeBoundsTree = TypeBoundsTree(EmptyTree, EmptyTree, EmptyTree)
158-
object WildcardTypeBoundsTree with
158+
object WildcardTypeBoundsTree:
159159
def unapply(tree: untpd.Tree): Boolean = tree match
160160
case TypeBoundsTree(EmptyTree, EmptyTree, _) => true
161161
case _ => false

compiler/src/dotty/tools/dotc/config/CommandLineParser.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import java.lang.Character.isWhitespace
66

77
/** A simple enough command line parser.
88
*/
9-
object CommandLineParser with
9+
object CommandLineParser:
1010
inline private val DQ = '"'
1111
inline private val SQ = '\''
1212
inline private val EOF = -1

compiler/src/dotty/tools/dotc/config/Feature.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import util.SrcPos
1010
import SourceVersion._
1111
import reporting.Message
1212

13-
object Feature with
13+
object Feature:
1414

1515
private val dependent = "dependent".toTermName
1616
private val namedTypeArguments = "namedTypeArguments".toTermName

compiler/src/dotty/tools/dotc/config/SourceVersion.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import core.StdNames.nme
88
import core.Decorators.{_, given}
99
import util.Property
1010

11-
enum SourceVersion with
11+
enum SourceVersion:
1212
case `3.0-migration`, `3.0`, `3.1-migration`, `3.1`
1313

1414
val isMigrating: Boolean = toString.endsWith("-migration")
@@ -18,7 +18,7 @@ enum SourceVersion with
1818

1919
def isAtLeast(v: SourceVersion) = stable.ordinal >= v.ordinal
2020

21-
object SourceVersion extends Property.Key[SourceVersion] with
21+
object SourceVersion extends Property.Key[SourceVersion]:
2222
def defaultSourceVersion = `3.0`
2323

2424
val allSourceVersionNames = values.toList.map(_.toString.toTermName)

compiler/src/dotty/tools/dotc/core/Atoms.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import Types._
1212
* If the underlying type of a singleton type is another singleton type,
1313
* only the latter type ends up in the sets.
1414
*/
15-
enum Atoms with
15+
enum Atoms:
1616
case Range(lo: Set[Type], hi: Set[Type])
1717
case Unknown
1818

compiler/src/dotty/tools/dotc/core/ConstraintHandling.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ trait ConstraintHandling {
249249
/** Substitute wildcards with fresh TypeParamRefs, to be compared with
250250
* other bound, so that they can be instantiated.
251251
*/
252-
object substWildcards extends TypeMap with
252+
object substWildcards extends TypeMap:
253253
override def stopAtStatic = true
254254

255255
var trackedPolis: List[PolyType] = Nil

compiler/src/dotty/tools/dotc/core/ContextOps.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import SymDenotations.LazyType, Names.Name, StdNames.nme
77
import ast.untpd
88

99
/** Extension methods for contexts where we want to keep the ctx.<methodName> syntax */
10-
object ContextOps with
10+
object ContextOps:
1111

1212
extension (ctx: Context)
1313

compiler/src/dotty/tools/dotc/core/Definitions.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1172,7 +1172,7 @@ class Definitions {
11721172

11731173
@tu lazy val TupleType: Array[TypeRef] = mkArityArray("scala.Tuple", MaxTupleArity, 1)
11741174

1175-
private class FunType(prefix: String) with
1175+
private class FunType(prefix: String):
11761176
private var classRefs: Array[TypeRef] = new Array(22)
11771177
def apply(n: Int): TypeRef =
11781178
while n >= classRefs.length do
@@ -1526,7 +1526,7 @@ class Definitions {
15261526
* dependent refinements. Optionally returns a triple consisting of the argument
15271527
* types `As`, the result type `B` and a whether the type is an erased context function.
15281528
*/
1529-
object ContextFunctionType with
1529+
object ContextFunctionType:
15301530
def unapply(tp: Type)(using Context): Option[(List[Type], Type, Boolean)] =
15311531
if ctx.erasedTypes then
15321532
atPhase(erasurePhase)(unapply(tp))

compiler/src/dotty/tools/dotc/core/NamerOps.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import config.Config
99
import ast.untpd
1010

1111
/** Operations that are shared between Namer and TreeUnpickler */
12-
object NamerOps with
12+
object NamerOps:
1313

1414
/** The given type, unless `sym` is a constructor, in which case the
1515
* type of the constructed instance is returned
@@ -83,7 +83,7 @@ object NamerOps with
8383
&& !cls.isAnonymousClass
8484

8585
/** The completer of a constructor proxy apply method */
86-
class ApplyProxyCompleter(constr: Symbol)(using Context) extends LazyType with
86+
class ApplyProxyCompleter(constr: Symbol)(using Context) extends LazyType:
8787
def complete(denot: SymDenotation)(using Context): Unit =
8888
denot.info = constr.info
8989

compiler/src/dotty/tools/dotc/core/Names.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -535,7 +535,7 @@ object Names {
535535
chrs.copyToArray(newchrs)
536536
chrs = newchrs
537537

538-
private class NameTable extends HashSet[SimpleName](initialCapacity = 0x10000, capacityMultiple = 2) with
538+
private class NameTable extends HashSet[SimpleName](initialCapacity = 0x10000, capacityMultiple = 2):
539539
import util.Stats
540540

541541
override def hash(x: SimpleName) = hashValue(chrs, x.start, x.length) // needed for resize

compiler/src/dotty/tools/dotc/core/Substituters.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import Types._, Symbols._, Contexts._, Decorators._
55
/** Substitution operations on types. See the corresponding `subst` and
66
* `substThis` methods on class Type for an explanation.
77
*/
8-
object Substituters with
8+
object Substituters:
99

1010
final def subst(tp: Type, from: BindingType, to: BindingType, theMap: SubstBindingMap)(using Context): Type =
1111
tp match {

compiler/src/dotty/tools/dotc/core/SymDenotations.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2556,7 +2556,7 @@ object SymDenotations {
25562556
def needsCompletion(symd: SymDenotation)(using Context): Boolean = true
25572557
}
25582558

2559-
object LazyType with
2559+
object LazyType:
25602560
private val NoSymbolFn = (_: Context) ?=> NoSymbol
25612561

25622562
/** A subtrait of LazyTypes where completerTypeParams yields a List[TypeSymbol], which

compiler/src/dotty/tools/dotc/core/Symbols.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -864,15 +864,15 @@ object Symbols {
864864
/** Matches lists of term symbols, including the empty list.
865865
* All symbols in the list are assumed to be of the same kind.
866866
*/
867-
object TermSymbols with
867+
object TermSymbols:
868868
def unapply(xs: List[Symbol])(using Context): Option[List[TermSymbol]] = xs match
869869
case (x: Symbol) :: _ if x.isType => None
870870
case _ => Some(xs.asInstanceOf[List[TermSymbol]])
871871

872872
/** Matches lists of type symbols, excluding the empty list.
873873
* All symbols in the list are assumed to be of the same kind.
874874
*/
875-
object TypeSymbols with
875+
object TypeSymbols:
876876
def unapply(xs: List[Symbol])(using Context): Option[List[TypeSymbol]] = xs match
877877
case (x: Symbol) :: _ if x.isType => Some(xs.asInstanceOf[List[TypeSymbol]])
878878
case _ => None

compiler/src/dotty/tools/dotc/core/TypeApplications.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ object TypeApplications {
3232
*
3333
* @param tycon C
3434
*/
35-
object EtaExpansion with
35+
object EtaExpansion:
3636

3737
def apply(tycon: Type)(using Context): Type =
3838
assert(tycon.typeParams.nonEmpty, tycon)

compiler/src/dotty/tools/dotc/core/TypeComparer.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2558,7 +2558,7 @@ class TypeComparer(@constructorOnly initctx: Context) extends ConstraintHandling
25582558

25592559
object TypeComparer {
25602560

2561-
enum CompareResult with
2561+
enum CompareResult:
25622562
case OK, Fail, OKwithGADTUsed
25632563

25642564
/** Class for unification variables used in `natValue`. */
@@ -2577,7 +2577,7 @@ object TypeComparer {
25772577
* - `LoApprox`: The left type is approximated (i.e widened)"
25782578
* - `HiApprox`: The right type is approximated (i.e narrowed)"
25792579
*/
2580-
object ApproxState with
2580+
object ApproxState:
25812581
opaque type Repr = Int
25822582

25832583
val None: Repr = 0

compiler/src/dotty/tools/dotc/core/TypeOps.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import reporting.TestingReporter
2424
import scala.annotation.internal.sharable
2525
import scala.annotation.threadUnsafe
2626

27-
object TypeOps with
27+
object TypeOps:
2828

2929
@sharable var track: Boolean = false // for debugging
3030

compiler/src/dotty/tools/dotc/core/Types.scala

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ object Types {
112112
def isProvisional(using Context): Boolean = mightBeProvisional && testProvisional
113113

114114
private def testProvisional(using Context): Boolean =
115-
class ProAcc extends TypeAccumulator[Boolean] with
115+
class ProAcc extends TypeAccumulator[Boolean]:
116116
override def apply(x: Boolean, t: Type) = x || test(t, this)
117117
def test(t: Type, theAcc: TypeAccumulator[Boolean]): Boolean =
118118
if t.mightBeProvisional then
@@ -3413,7 +3413,7 @@ object Types {
34133413
private var myParamDependencyStatus: DependencyStatus = Unknown
34143414

34153415
private def depStatus(initial: DependencyStatus, tp: Type)(using Context): DependencyStatus =
3416-
class DepAcc extends TypeAccumulator[DependencyStatus] with
3416+
class DepAcc extends TypeAccumulator[DependencyStatus]:
34173417
def apply(status: DependencyStatus, tp: Type) = compute(status, tp, this)
34183418
def combine(x: DependencyStatus, y: DependencyStatus) =
34193419
val status = (x & StatusMask) max (y & StatusMask)
@@ -4419,7 +4419,7 @@ object Types {
44194419
s"TypeVar($origin$instStr)"
44204420
}
44214421
}
4422-
object TypeVar with
4422+
object TypeVar:
44234423
def apply(initOrigin: TypeParamRef, creatorState: TyperState)(using Context) =
44244424
new TypeVar(initOrigin, creatorState, ctx.owner.nestingLevel)
44254425

@@ -4841,7 +4841,7 @@ object Types {
48414841

48424842
class CachedAnnotatedType(parent: Type, annot: Annotation) extends AnnotatedType(parent, annot)
48434843

4844-
object AnnotatedType with
4844+
object AnnotatedType:
48454845
def make(underlying: Type, annots: List[Annotation])(using Context): Type =
48464846
annots.foldLeft(underlying)(apply(_, _))
48474847
def apply(parent: Type, annot: Annotation)(using Context): AnnotatedType =
@@ -4889,14 +4889,14 @@ object Types {
48894889
def msg(using Context): Message
48904890
}
48914891

4892-
object ErrorType with
4892+
object ErrorType:
48934893
def apply(m: Message)(using Context): ErrorType =
48944894
val et = new PreviousErrorType
48954895
ctx.base.errorTypeMsg(et) = m
48964896
et
48974897
end ErrorType
48984898

4899-
class PreviousErrorType extends ErrorType with
4899+
class PreviousErrorType extends ErrorType:
49004900
def msg(using Context): Message =
49014901
ctx.base.errorTypeMsg.get(this) match
49024902
case Some(m) => m
@@ -5053,7 +5053,7 @@ object Types {
50535053
// ----- TypeMaps --------------------------------------------------------------------
50545054

50555055
/** Common base class of TypeMap and TypeAccumulator */
5056-
abstract class VariantTraversal with
5056+
abstract class VariantTraversal:
50575057
protected[core] var variance: Int = 1
50585058

50595059
inline protected def atVariance[T](v: Int)(op: => T): T = {

compiler/src/dotty/tools/dotc/core/Uniques.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import config.Config
66
import Decorators._
77
import util.{HashSet, Stats}
88

9-
class Uniques extends HashSet[Type](Config.initialUniquesCapacity) with
9+
class Uniques extends HashSet[Type](Config.initialUniquesCapacity):
1010
override def hash(x: Type): Int = x.hash
1111
override def isEqual(x: Type, y: Type) = x.eql(y)
1212

@@ -15,7 +15,7 @@ class Uniques extends HashSet[Type](Config.initialUniquesCapacity) with
1515
* All sets offer a `enterIfNew` method which checks whether a type
1616
* with the given parts exists already and creates a new one if not.
1717
*/
18-
object Uniques with
18+
object Uniques:
1919

2020
private inline def recordCaching(tp: Type): Unit = recordCaching(tp.hash, tp.getClass)
2121
private inline def recordCaching(h: Int, clazz: Class[?]): Unit =
@@ -32,7 +32,7 @@ object Uniques with
3232
if tp.hash == NotCached then tp
3333
else ctx.uniques.put(tp).asInstanceOf[T]
3434

35-
final class NamedTypeUniques extends HashSet[NamedType](Config.initialUniquesCapacity * 4) with Hashable with
35+
final class NamedTypeUniques extends HashSet[NamedType](Config.initialUniquesCapacity * 4) with Hashable:
3636
override def hash(x: NamedType): Int = x.hash
3737

3838
def enterIfNew(prefix: Type, designator: Designator, isTerm: Boolean)(using Context): NamedType =
@@ -53,7 +53,7 @@ object Uniques with
5353
addEntryAt(idx, newType)
5454
end NamedTypeUniques
5555

56-
final class AppliedUniques extends HashSet[AppliedType](Config.initialUniquesCapacity * 2) with Hashable with
56+
final class AppliedUniques extends HashSet[AppliedType](Config.initialUniquesCapacity * 2) with Hashable:
5757
override def hash(x: AppliedType): Int = x.hash
5858

5959
def enterIfNew(tycon: Type, args: List[Type]): AppliedType =

compiler/src/dotty/tools/dotc/core/tasty/CommentPickler.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import dotty.tools.tasty.TastyFormat.CommentsSection
1010

1111
import java.nio.charset.StandardCharsets
1212

13-
class CommentPickler(pickler: TastyPickler, addrOfTree: tpd.Tree => Addr, docString: untpd.MemberDef => Option[Comment]) with
13+
class CommentPickler(pickler: TastyPickler, addrOfTree: tpd.Tree => Addr, docString: untpd.MemberDef => Option[Comment]):
1414
private val buf = new TastyBuffer(5000)
1515
pickler.newSection(CommentsSection, buf)
1616

0 commit comments

Comments
 (0)