Skip to content

Commit ac9587e

Browse files
committed
Ensure spaces after if in Dotty source.
1 parent d080478 commit ac9587e

24 files changed

+51
-51
lines changed

project/Build.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ object DottyBuild extends Build {
109109
val path = for {
110110
file <- attList.map(_.data)
111111
path = file.getAbsolutePath
112-
prefix = if(path.endsWith(".jar")) "p" else "a"
112+
prefix = if (path.endsWith(".jar")) "p" else "a"
113113
} yield "-Xbootclasspath/" + prefix + ":" + path
114114
// dotty itself needs to be in the bootclasspath
115115
val fullpath = ("-Xbootclasspath/a:" + bin) :: path.toList

src/dotty/tools/backend/jvm/CollectEntryPoints.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class CollectEntryPoints extends MiniPhaseTransform {
4040
def phaseName: String = "Collect entry points"
4141

4242
override def transformDefDef(tree: tpd.DefDef)(implicit ctx: Context, info: TransformerInfo): tpd.Tree = {
43-
if((tree.symbol ne NoSymbol) && CollectEntryPoints.isJavaEntyPoint(tree.symbol)) {
43+
if ((tree.symbol ne NoSymbol) && CollectEntryPoints.isJavaEntyPoint(tree.symbol)) {
4444
ctx.genBCodePhase.asInstanceOf[GenBCode].registerEntryPoint(tree.symbol)
4545
}
4646
tree

src/dotty/tools/backend/jvm/DottyBackendInterface.scala

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ class DottyBackendInterface()(implicit ctx: Context) extends BackendInterface{
376376
def shouldEmitJumpAfterLabels = true
377377

378378
def dumpClasses: Option[String] =
379-
if(ctx.settings.Ydumpclasses.isDefault) None
379+
if (ctx.settings.Ydumpclasses.isDefault) None
380380
else Some(ctx.settings.Ydumpclasses.value)
381381

382382
def mainClass: Option[String] =
@@ -423,7 +423,7 @@ class DottyBackendInterface()(implicit ctx: Context) extends BackendInterface{
423423
case TermRef(prefix: ThisType, name) =>
424424
Some(tpd.This(prefix.cls).select(i.symbol))
425425
case TermRef(NoPrefix, name) =>
426-
if(i.symbol is Flags.Method) Some(This(i.symbol.enclosingClass).select(i.symbol)) // workaround #342 todo: remove after fixed
426+
if (i.symbol is Flags.Method) Some(This(i.symbol.enclosingClass).select(i.symbol)) // workaround #342 todo: remove after fixed
427427
else None
428428
case _ => None
429429
}
@@ -663,7 +663,7 @@ class DottyBackendInterface()(implicit ctx: Context) extends BackendInterface{
663663
def companionSymbol: Symbol = if (sym is Flags.Module) companionClass else companionModule
664664
def moduleClass: Symbol = toDenot(sym).moduleClass
665665
def enclosingClassSym: Symbol = {
666-
if(this.isClass) {
666+
if (this.isClass) {
667667
val ct = ctx.withPhase(ctx.flattenPhase.prev)
668668
toDenot(sym)(ct).owner.enclosingClass(ct)
669669
}
@@ -792,7 +792,7 @@ class DottyBackendInterface()(implicit ctx: Context) extends BackendInterface{
792792
t.info match {
793793

794794
case _ =>
795-
if(!t.symbol.isClass) nonClassTypeRefToBType(t.symbol) // See comment on nonClassTypeRefToBType
795+
if (!t.symbol.isClass) nonClassTypeRefToBType(t.symbol) // See comment on nonClassTypeRefToBType
796796
else primitiveOrClassToBType(t.symbol) // Common reference to a type such as scala.Int or java.lang.String
797797
}
798798
case Types.ClassInfo(_, sym, _, _, _) => primitiveOrClassToBType(sym) // We get here, for example, for genLoadModule, which invokes toTypeKind(moduleClassSymbol.info)
@@ -942,7 +942,7 @@ class DottyBackendInterface()(implicit ctx: Context) extends BackendInterface{
942942
def _3: Tree = field.rhs
943943

944944
override def unapply(s: LabelDef): DottyBackendInterface.this.LabelDef.type = {
945-
if(s.symbol is Flags.Label) this.field = s
945+
if (s.symbol is Flags.Label) this.field = s
946946
else this.field = null
947947
this
948948
}
@@ -1021,11 +1021,11 @@ class DottyBackendInterface()(implicit ctx: Context) extends BackendInterface{
10211021
def _2 = field.meth
10221022
def _3 = {
10231023
val t = field.tpt.tpe.typeSymbol
1024-
if(t.exists) t
1024+
if (t.exists) t
10251025
else {
10261026
val arity = field.meth.tpe.widenDealias.paramTypes.size - _1.size
10271027
val returnsUnit = field.meth.tpe.widenDealias.resultType.classSymbol == UnitClass
1028-
if(returnsUnit)
1028+
if (returnsUnit)
10291029
ctx.requiredClass(("scala.compat.java8.JProcedure" + arity).toTermName)
10301030
else ctx.requiredClass(("scala.compat.java8.JFunction" + arity).toTermName)
10311031
}

src/dotty/tools/backend/jvm/LabelDefs.scala

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ import StdNames.nme
4444
*
4545
* <label> def foo(i: Int) = {
4646
* <label> def bar = 0
47-
* <label> def dough(i: Int) = if(i == 0) bar else foo(i-1)
47+
* <label> def dough(i: Int) = if (i == 0) bar else foo(i-1)
4848
* dough(i)
4949
* }
5050
*
@@ -54,7 +54,7 @@ import StdNames.nme
5454
*
5555
* \
5656
* <label> def foo(i: Int) = dough(i)
57-
* <label> def dough(i: Int) = if(i == 0) bar else foo(i-1)
57+
* <label> def dough(i: Int) = if (i == 0) bar else foo(i-1)
5858
* <label> def bar = 2
5959
* foo(100)
6060
*
@@ -64,7 +64,7 @@ import StdNames.nme
6464
* <jump foo>
6565
* <label> def foo(i: Int) = dough(i)
6666
* // <jump a> // unreachable
67-
* <label> def dough(i: Int) = if(i == 0) bar else foo(i-1)
67+
* <label> def dough(i: Int) = if (i == 0) bar else foo(i-1)
6868
* // <jump a> // unreachable
6969
* <label> def bar = 2
7070
* // <jump a> // unreachable
@@ -107,7 +107,7 @@ class LabelDefs extends MiniPhaseTransform {
107107
labelLevel = labelLevel + 1
108108
val r = Block(moveLabels(t), t)
109109
labelLevel = labelLevel - 1
110-
if(labelLevel == 0) beingAppended.clear()
110+
if (labelLevel == 0) beingAppended.clear()
111111
r
112112
case _ => if (entryPoints.nonEmpty && labelDefs.nonEmpty) super.transform(tree) else tree
113113
}
@@ -206,14 +206,14 @@ class LabelDefs extends MiniPhaseTransform {
206206
labelCalls(r.symbol) = parentLabelCalls
207207
parentLabelCalls = st
208208

209-
if(shouldMoveLabel) {
209+
if (shouldMoveLabel) {
210210
labelDefs(r.symbol) = r
211211
EmptyTree
212212
} else r
213213
case t: Apply if t.symbol is Flags.Label =>
214214
val sym = t.symbol
215215
parentLabelCalls = parentLabelCalls + t
216-
if(owner != sym) callCounts(sym) = callCounts(sym) + 1
216+
if (owner != sym) callCounts(sym) = callCounts(sym) + 1
217217
super.transform(tree)
218218
case _ =>
219219
super.transform(tree)

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -776,7 +776,7 @@ object tpd extends Trees.Instance[Type] with TypedTreeInfo {
776776
} else args
777777
}
778778

779-
val callArgs: List[Tree] = if(args.isEmpty) Nil else {
779+
val callArgs: List[Tree] = if (args.isEmpty) Nil else {
780780
val expectedType = selected.widen.paramTypess.head.last
781781
val lastParam = args.last
782782
adaptLastArg(lastParam, expectedType)

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ trait Symbols { this: Context =>
162162
privateWithin, coord, assocFile)
163163

164164
def synthesizeCompanionMethod(name: Name, target: SymDenotation, owner: SymDenotation)(implicit ctx: Context) =
165-
if(owner.exists && target.exists && !owner.isAbsent && !target.isAbsent) {
165+
if (owner.exists && target.exists && !owner.isAbsent && !target.isAbsent) {
166166
val existing = owner.unforcedDecls.lookup(name)
167167

168168
existing.orElse{

src/dotty/tools/dotc/core/TypeErasure.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ object TypeErasure {
9595
def erasure(tp: Type)(implicit ctx: Context): Type = scalaErasureFn(tp)(erasureCtx)
9696
def semiErasure(tp: Type)(implicit ctx: Context): Type = semiErasureFn(tp)(erasureCtx)
9797
def sigName(tp: Type, isJava: Boolean)(implicit ctx: Context): TypeName = {
98-
val seqClass = if(isJava) defn.ArrayClass else defn.SeqClass
98+
val seqClass = if (isJava) defn.ArrayClass else defn.SeqClass
9999
val normTp =
100100
if (tp.isRepeatedParam) tp.translateParameterized(defn.RepeatedParamClass, seqClass)
101101
else tp

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ object Types {
7676

7777
val uniqId = {
7878
nextId = nextId + 1
79-
// if(nextId == 19555)
79+
// if (nextId == 19555)
8080
// println("foo")
8181
nextId
8282
}

src/dotty/tools/dotc/core/pickling/ClassfileParser.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ class ClassfileParser(
9292
if (c != classRoot.symbol) mismatchError(c)
9393
}
9494

95-
if(classRoot.symbol.id == 4812) {
95+
if (classRoot.symbol.id == 4812) {
9696
println("bar")
9797
}
9898

src/dotty/tools/dotc/parsing/JavaParsers.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,11 +121,11 @@ object JavaParsers {
121121
case nil => (EmptyTree, nil)
122122
}
123123
var (constr1, stats1) = pullOutFirstConstr(stats)
124-
if(constr1 == EmptyTree) constr1 = makeConstructor(List(), tparams)
124+
if (constr1 == EmptyTree) constr1 = makeConstructor(List(), tparams)
125125
// A dummy first constructor is needed for Java classes so that the real constructors see the
126126
// import of the companion object. The constructor has parameter of type Unit so no Java code
127127
// can call it.
128-
if(needsDummyConstr) {
128+
if (needsDummyConstr) {
129129
stats1 = constr1 :: stats1
130130
constr1 = makeConstructor(List(scalaDot(tpnme.Unit)), tparams, Flags.JavaDefined | Flags.PrivateLocal)
131131
}
@@ -579,9 +579,9 @@ object JavaParsers {
579579
def varDecl(pos: Position, mods: Modifiers, tpt: Tree, name: TermName): ValDef = {
580580
val tpt1 = optArrayBrackets(tpt)
581581
if (in.token == EQUALS && !(mods is Flags.Param)) skipTo(COMMA, SEMI)
582-
val mods1 = if(mods is Flags.Final) mods else mods | Flags.Mutable
582+
val mods1 = if (mods is Flags.Final) mods else mods | Flags.Mutable
583583
atPos(pos) {
584-
ValDef(name, tpt1, if(mods is Flags.Param) EmptyTree else unimplementedExpr).withMods(mods1)
584+
ValDef(name, tpt1, if (mods is Flags.Param) EmptyTree else unimplementedExpr).withMods(mods1)
585585
}
586586
}
587587

src/dotty/tools/dotc/parsing/Utility.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ object Utility {
6969
else sb append c
7070
}
7171

72-
if(!sb.isEmpty) // flush buffer
72+
if (!sb.isEmpty) // flush buffer
7373
nb += text(sb.toString())
7474

7575
nb.toList

src/dotty/tools/dotc/transform/Erasure.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ object Erasure extends TypeTestsCasts{
412412

413413
private def adaptProto(tree: untpd.Tree, pt: Type)(implicit ctx: Context) = {
414414
if (pt.isValueType) pt else {
415-
if(tree.typeOpt.derivesFrom(ctx.definitions.UnitClass))
415+
if (tree.typeOpt.derivesFrom(ctx.definitions.UnitClass))
416416
tree.typeOpt
417417
else erasure(tree.typeOpt)
418418
}

src/dotty/tools/dotc/transform/FullParameterization.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ trait FullParameterization {
9191
case info: ExprType => (0, info.resultType)
9292
case _ => (0, info)
9393
}
94-
val ctparams = if(abstractOverClass) clazz.typeParams else Nil
94+
val ctparams = if (abstractOverClass) clazz.typeParams else Nil
9595
val ctnames = ctparams.map(_.name.unexpandedName)
9696

9797
/** The method result type */

src/dotty/tools/dotc/transform/LazyVals.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class LazyVals extends MiniPhaseTransform with SymTransformer {
2727

2828

2929
def transformSym(d: SymDenotation)(implicit ctx: Context): SymDenotation = {
30-
if(d is(Flags.Lazy, butNot = Flags.ModuleVal | Flags.Method)) {
30+
if (d is(Flags.Lazy, butNot = Flags.ModuleVal | Flags.Method)) {
3131
// Method flag is set on lazy vals coming from Unpickler. They are already methods and shouldn't be transformed twice
3232
d.copySymDenotation(
3333
initFlags = d.flags | Flags.Method,
@@ -301,7 +301,7 @@ class LazyVals extends MiniPhaseTransform with SymTransformer {
301301
info.ord += 1
302302
ord = info.ord % flagsPerLong
303303
val id = info.ord / flagsPerLong
304-
if(ord != 0) { // there are unused bits in already existing flag
304+
if (ord != 0) { // there are unused bits in already existing flag
305305
offsetSymbol = companion.moduleClass.info.decl((StdNames.nme.LAZY_FIELD_OFFSET + id.toString).toTermName)
306306
.suchThat(sym => (sym is Flags.Synthetic) && sym.isTerm)
307307
.symbol.asTerm
@@ -335,7 +335,7 @@ class LazyVals extends MiniPhaseTransform with SymTransformer {
335335
val cas = Select(ref(helperModule), RLazyVals.Names.cas.toTermName)
336336

337337
val accessor = mkThreadSafeDef(x.symbol.asTerm, claz, ord, containerSymbol, x.rhs, tpe, offset, getFlag, state, cas, setFlag, wait)
338-
if(flag eq EmptyTree)
338+
if (flag eq EmptyTree)
339339
Thicket(List(containerTree, accessor))
340340
else Thicket(List(containerTree, flag, accessor))
341341
}

src/dotty/tools/dotc/transform/PatternMatcher.scala

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ class PatternMatcher extends MiniPhaseTransform with DenotTransformer {thisTrans
179179
override def codegen: AbsCodegen = optimizedCodegen
180180

181181
// when we know we're targetting Option, do some inlining the optimizer won't do
182-
// for example, `o.flatMap(f)` becomes `if(o == None) None else f(o.get)`, similarly for orElse and guard
182+
// for example, `o.flatMap(f)` becomes `if (o == None) None else f(o.get)`, similarly for orElse and guard
183183
// this is a special instance of the advanced inlining optimization that takes a method call on
184184
// an object of a type that only has two concrete subclasses, and inlines both bodies, guarded by an if to distinguish the two cases
185185
object optimizedCodegen extends CommonCodegen {
@@ -407,11 +407,11 @@ class PatternMatcher extends MiniPhaseTransform with DenotTransformer {thisTrans
407407

408408
val nextBinder: Symbol
409409
lazy val introducedRebindings = /*
410-
if(nextBinder ne prevBinder) Rebindings(prevBinder, nextBinder)
410+
if (nextBinder ne prevBinder) Rebindings(prevBinder, nextBinder)
411411
else */ NoRebindings
412412

413413
def chainBefore(next: Tree)(casegen: Casegen): Tree =
414-
if(prevBinder ne nextBinder) // happens when typeTest is known to succeed
414+
if (prevBinder ne nextBinder) // happens when typeTest is known to succeed
415415
/*atPos(pos)(*/casegen.flatMapCond(cond, res, nextBinder, next)//)
416416
else casegen.flatMapGuard(cond, next)
417417
}
@@ -477,7 +477,7 @@ class PatternMatcher extends MiniPhaseTransform with DenotTransformer {thisTrans
477477
def refTpeWiden = ref.tpe.widen
478478
def bindInfoWiden = bind.info.widen
479479
def loc = bind.showFullName
480-
if(!(ref.tpe <:< bind.info.widen)) {
480+
if (!(ref.tpe <:< bind.info.widen)) {
481481
ctx.debuglog(s"here ${bind.showFullName} expected: ${bindInfoWiden.show} got: ${refTpeWiden.show}")
482482
}
483483
val refCasted = ref.ensureConforms(bind.info)
@@ -954,7 +954,7 @@ class PatternMatcher extends MiniPhaseTransform with DenotTransformer {thisTrans
954954
object WildcardPattern {
955955
def unapply(pat: Tree): Boolean = pat match {
956956
case Bind(nme.WILDCARD, WildcardPattern()) => true // don't skip when binding an interesting symbol!
957-
case t if(tpd.isWildcardArg(t)) => true
957+
case t if (tpd.isWildcardArg(t)) => true
958958
case x: Ident => isVarPattern(x)
959959
case Alternative(ps) => ps forall unapply
960960
case EmptyTree => true
@@ -1424,7 +1424,7 @@ class PatternMatcher extends MiniPhaseTransform with DenotTransformer {thisTrans
14241424
else genDrop(binder, expectedLength)
14251425
)
14261426
// this error-condition has already been checked by checkStarPatOK:
1427-
// if(isSeq) assert(firstIndexingBinder + nbIndexingIndices + (if(lastIsStar) 1 else 0) == totalArity, "(resultInMonad, ts, subPatTypes, subPats)= " +(resultInMonad, ts, subPatTypes, subPats))
1427+
// if (isSeq) assert(firstIndexingBinder + nbIndexingIndices + (if(lastIsStar) 1 else 0) == totalArity, "(resultInMonad, ts, subPatTypes, subPats)= " +(resultInMonad, ts, subPatTypes, subPats))
14281428

14291429
// [1] there are `firstIndexingBinder` non-seq tuple elements preceding the Seq
14301430
// [2] then we have to index the binder that represents the sequence for the remaining subpatterns, except for...
@@ -1440,7 +1440,7 @@ class PatternMatcher extends MiniPhaseTransform with DenotTransformer {thisTrans
14401440
// require (nbSubPats > 0 && (!lastIsStar || isSeq))
14411441
protected def subPatRefs(binder: Symbol): List[Tree] = {
14421442
val refs = if (totalArity > 0 && isSeq) subPatRefsSeq(binder)
1443-
else if(defn.isProductSubType(binder.info)) productElemsToN(binder, totalArity)
1443+
else if (defn.isProductSubType(binder.info)) productElemsToN(binder, totalArity)
14441444
else ref(binder):: Nil
14451445
val refsSymbols = refs.map(_.symbol) // just for debugging
14461446
refs
@@ -1551,7 +1551,7 @@ class PatternMatcher extends MiniPhaseTransform with DenotTransformer {thisTrans
15511551
// the trees that select the subpatterns on the extractor's result, referenced by `binder`
15521552
// require (totalArity > 0 && (!lastIsStar || isSeq))
15531553
protected def subPatRefs(binder: Symbol, subpatBinders: List[Symbol], binderTypeTested: Type): List[Tree] = {
1554-
if(aligner.isSingle && aligner.extractor.prodArity == 1 && defn.isTupleType(binder.info)) {
1554+
if (aligner.isSingle && aligner.extractor.prodArity == 1 && defn.isTupleType(binder.info)) {
15551555
// special case for extractor
15561556
// comparing with scalac additional assertions added
15571557
val subpw = subpatBinders.head.info.widen
@@ -1815,8 +1815,8 @@ class PatternMatcher extends MiniPhaseTransform with DenotTransformer {thisTrans
18151815
//println(s"${_id}unapplyArgs(${result.widen}")
18161816
val expanded:List[Type] = /*(
18171817
if (result =:= defn.BooleanType) Nil
1818-
else if(defn.isProductSubType(result)) productSelectorTypes(result)
1819-
else if(result.classSymbol is Flags.CaseClass) result.decls.filter(x => x.is(Flags.CaseAccessor) && x.is(Flags.Method)).map(_.info).toList
1818+
else if (defn.isProductSubType(result)) productSelectorTypes(result)
1819+
else if (result.classSymbol is Flags.CaseClass) result.decls.filter(x => x.is(Flags.CaseAccessor) && x.is(Flags.Method)).map(_.info).toList
18201820
else result.select(nme.get) :: Nil
18211821
)*/
18221822
if ((extractorMemberType(resultType, nme.isDefined) isRef defn.BooleanClass) && resultOfGet.exists)

src/dotty/tools/dotc/transform/SuperAccessors.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,7 @@ class SuperAccessors extends MacroTransform with IdentityDenotTransformer { this
554554
assert(referencingClass.isClass, referencingClass)
555555
referencingClass
556556
}
557-
else if(referencingClass.owner.enclosingClass.exists)
557+
else if (referencingClass.owner.enclosingClass.exists)
558558
hostForAccessorOf(sym, referencingClass.owner.enclosingClass.asClass)
559559
else
560560
referencingClass

src/dotty/tools/dotc/transform/TailRec.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ class TailRec extends MiniPhaseTransform with DenotTransformer with FullParamete
210210
val reciever = noTailTransform(recv)
211211

212212
val callTargs: List[tpd.Tree] =
213-
if(abstractOverClass) {
213+
if (abstractOverClass) {
214214
val classTypeArgs = recv.tpe.baseTypeWithArgs(enclosingClass).argInfos
215215
targs ::: classTypeArgs.map(x => ref(x.typeSymbol))
216216
} else targs

src/dotty/tools/dotc/transform/TraitConstructors.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class TraitConstructors extends MiniPhaseTransform with SymTransformer {
2222
override def treeTransformPhase: Phase = this.phase
2323

2424
def transformSym(sym: SymDenotation)(implicit ctx: Context): SymDenotation = {
25-
if(sym.isPrimaryConstructor && (sym.owner is Flags.Trait))
25+
if (sym.isPrimaryConstructor && (sym.owner is Flags.Trait))
2626
sym.copySymDenotation(name = nme.INITIALIZER_PREFIX ++ sym.owner.fullName)
2727
else sym
2828
}

src/dotty/tools/dotc/transform/TreeChecker.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,15 +116,15 @@ class TreeChecker extends Phase with SymTransformer {
116116
val sym = tree.symbol
117117
everDefinedSyms.get(sym) match {
118118
case Some(t) =>
119-
if(t ne tree)
119+
if (t ne tree)
120120
ctx.warning(i"symbol ${sym.fullName} is defined at least twice in different parts of AST")
121121
// should become an error
122122
case None =>
123123
everDefinedSyms(sym) = tree
124124
}
125125
assert(!nowDefinedSyms.contains(sym), i"doubly defined symbol: ${sym.fullName} in $tree")
126126

127-
if(ctx.settings.YcheckMods.value) {
127+
if (ctx.settings.YcheckMods.value) {
128128
tree match {
129129
case t: MemberDef =>
130130
if (t.name ne sym.name) ctx.warning(s"symbol ${sym.fullName} name doesn't correspond to AST: ${t}")

src/dotty/tools/dotc/transform/TreeTransform.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ object TreeTransforms {
186186
case ref: SymDenotation =>
187187
val annotTrees = ref.annotations.map(_.tree)
188188
val annotTrees1 = annotTrees.mapConserve(annotationTransformer.macroTransform)
189-
val annots1 = if(annotTrees eq annotTrees1) ref.annotations else annotTrees1.map(new ConcreteAnnotation(_))
189+
val annots1 = if (annotTrees eq annotTrees1) ref.annotations else annotTrees1.map(new ConcreteAnnotation(_))
190190
if ((info1 eq ref.info) && (annots1 eq ref.annotations)) ref
191191
else ref.copySymDenotation(info = info1, annotations = annots1)
192192
case _ => if (info1 eq ref.info) ref else ref.derivedSingleDenotation(ref.symbol, info1)

0 commit comments

Comments
 (0)