Skip to content

Commit 2b3591c

Browse files
committed
Remove trailing whitespace
I have figured out how to make this the default in Eclipse, so hopefully we won't see many repeats of this.
1 parent 36c229b commit 2b3591c

12 files changed

+62
-62
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,9 +210,9 @@ object SymDenotations {
210210
/** Does this denotation have an annotation matching the given class symbol? */
211211
final def hasAnnotation(cls: Symbol)(implicit ctx: Context) =
212212
dropOtherAnnotations(annotations, cls).nonEmpty
213-
213+
214214
/** Apply transform `f` to all annotations of this denotation */
215-
final def transformAnnotations(f: Annotation => Annotation)(implicit ctx: Context): Unit =
215+
final def transformAnnotations(f: Annotation => Annotation)(implicit ctx: Context): Unit =
216216
annotations = annotations.mapConserve(f)
217217

218218
/** Optionally, the annotation matching the given class symbol */

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,7 @@ object Symbols {
560560

561561
/** The Definitions object */
562562
def defn(implicit ctx: Context): Definitions = ctx.definitions
563-
563+
564564
/** The current class */
565565
def currentClass(implicit ctx: Context): ClassSymbol = ctx.owner.enclosingClass.asClass
566566

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ class TypeApplications(val self: Type) extends AnyVal {
279279
default
280280
}
281281
}
282-
282+
283283
/** Translate a type of the form From[T] to To[T], keep other types as they are.
284284
* `from` and `to` must be static classes, both with one type parameter, and the same variance.
285285
*/

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1788,12 +1788,12 @@ object Types {
17881788
if (false) RefinedType(parent, refinedName, refinedInfo)
17891789
else RefinedType(parent, refinedName, rt => refinedInfo.substSkolem(this, SkolemType(rt)))
17901790
}
1791-
1791+
17921792
/** Add this refinement to `parent`, provided If `refinedName` is a member of `parent`. */
17931793
def wrapIfMember(parent: Type)(implicit ctx: Context): Type =
17941794
if (parent.member(refinedName).exists) derivedRefinedType(parent, refinedName, refinedInfo)
17951795
else parent
1796-
1796+
17971797
override def equals(that: Any) = that match {
17981798
case that: RefinedType =>
17991799
this.parent == that.parent &&
@@ -2414,7 +2414,7 @@ object Types {
24142414
selfTypeCache = {
24152415
def fullRef = fullyAppliedRef(cls.typeRef, cls.typeParams)
24162416
val given = givenSelfType
2417-
val raw =
2417+
val raw =
24182418
if (!given.exists) fullRef
24192419
else if (cls is Module) given
24202420
else if (ctx.erasedTypes) fullRef
@@ -2423,7 +2423,7 @@ object Types {
24232423
}
24242424
selfTypeCache
24252425
}
2426-
2426+
24272427
/** The explicitly given self type (self types of modules are assumed to be
24282428
* explcitly given here).
24292429
*/

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -669,7 +669,7 @@ class TreeUnpickler(reader: TastyReader, tastyName: TastyName.Table) {
669669
case _ =>
670670
readTerm()(ctx.withOwner(exprOwner))
671671
}
672-
672+
673673
def readImport()(implicit ctx: Context): Tree = {
674674
readByte()
675675
readEnd()

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class ExtensionMethods extends MiniPhaseTransform with DenotTransformer with Ful
3030
override def phaseName: String = "extmethods"
3131

3232
override def runsAfter: Set[Class[_ <: Phase]] = Set(classOf[ElimRepeated])
33-
33+
3434
override def runsAfterGroupsOf = Set(classOf[FirstTransform]) // need companion objects to exist
3535

3636
override def transform(ref: SingleDenotation)(implicit ctx: Context): SingleDenotation = ref match {

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

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -107,18 +107,18 @@ class LambdaLift extends MiniPhase with IdentityDenotTransformer { thisTransform
107107
* in `enclosure` or there is an intermediate class properly containing `enclosure`
108108
* in which `sym` is also free. Also, update `liftedOwner` of `enclosure` so
109109
* that `enclosure` can access `sym`, or its proxy in an intermediate class.
110-
* This means:
111-
*
110+
* This means:
111+
*
112112
* 1. If there is an intermediate class in which `sym` is free, `enclosure`
113-
* must be contained in that class (in order to access the `sym proxy stored
113+
* must be contained in that class (in order to access the `sym proxy stored
114114
* in the class).
115-
*
115+
*
116116
* 2. If there is no intermediate class, `enclosure` must be contained
117117
* in the class enclosing `sym`.
118-
*
118+
*
119119
* Return the closest enclosing intermediate class between `enclosure` and
120120
* the owner of sym, or NoSymbol if none exists.
121-
*
121+
*
122122
* pre: sym.owner.isTerm, (enclosure.isMethod || enclosure.isClass)
123123
*
124124
* The idea of `markFree` is illustrated with an example:
@@ -150,10 +150,10 @@ class LambdaLift extends MiniPhase with IdentityDenotTransformer { thisTransform
150150
else {
151151
ctx.log(i"mark free: ${sym.showLocated} with owner ${sym.maybeOwner} marked free in $enclosure")
152152
ctx.debuglog(i"$enclosure != ${sym.enclosure}")
153-
val intermediate =
153+
val intermediate =
154154
if (enclosure.is(PackageClass)) enclosure
155-
else markFree(sym, enclosure.skipConstructor.enclosure)
156-
// `enclosure` might be a constructor, in which case we want the enclosure
155+
else markFree(sym, enclosure.skipConstructor.enclosure)
156+
// `enclosure` might be a constructor, in which case we want the enclosure
157157
// of the enclosing class, so skipConstructor is needed here.
158158
if (intermediate.exists) {
159159
narrowLiftedOwner(enclosure, intermediate)
@@ -394,12 +394,12 @@ class LambdaLift extends MiniPhase with IdentityDenotTransformer { thisTransform
394394
val sym = tree.symbol
395395
tree.tpe match {
396396
case tpe @ TermRef(prefix, _) =>
397-
if (prefix eq NoPrefix)
397+
if (prefix eq NoPrefix)
398398
if (sym.enclosure != currentEnclosure && !sym.isStatic)
399399
(if (sym is Method) memberRef(sym) else proxyRef(sym)).withPos(tree.pos)
400400
else if (sym.owner.isClass) // sym was lifted out
401401
ref(sym).withPos(tree.pos)
402-
else
402+
else
403403
tree
404404
else if (!prefixIsElidable(tpe)) ref(tpe)
405405
else tree

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import Contexts._, Types._, Symbols._, Flags._, TypeUtils._, DenotTransformers._
2121
*/
2222
class ParamForwarding(thisTransformer: DenotTransformer) {
2323
import ast.tpd._
24-
24+
2525
def forwardParamAccessors(impl: Template)(implicit ctx: Context): Template = {
2626
def fwd(stats: List[Tree])(implicit ctx: Context): List[Tree] = {
2727
val (superArgs, superParamNames) = impl.parents match {
@@ -68,4 +68,4 @@ class ParamForwarding(thisTransformer: DenotTransformer) {
6868

6969
cpy.Template(impl)(body = fwd(impl.body)(ctx.withPhase(thisTransformer)))
7070
}
71-
}
71+
}

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

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -16,26 +16,26 @@ import Decorators._
1616
import Symbols._, TypeUtils._
1717

1818
/** A macro transform that runs immediately after typer and that performs the following functions:
19-
*
19+
*
2020
* (1) Add super accessors and protected accessors (@see SuperAccessors)
21-
*
21+
*
2222
* (2) Convert parameter fields that have the same name as a corresponding
2323
* public parameter field in a superclass to a forwarder to the superclass
2424
* field (corresponding = super class field is initialized with subclass field)
2525
* (@see ForwardParamAccessors)
26-
*
26+
*
2727
* (3) Add synthetic methods (@see SyntheticMethods)
28-
*
28+
*
2929
* (4) Check that `New` nodes can be instantiated, and that annotations are valid
30-
*
30+
*
3131
* (5) Convert all trees representing types to TypeTrees.
32-
*
32+
*
3333
* (6) Check the bounds of AppliedTypeTrees
34-
*
34+
*
3535
* (7) Insert `.package` for selections of package object members
36-
*
36+
*
3737
* (8) Replaces self references by name with `this`
38-
*
38+
*
3939
* The reason for making this a macro transform is that some functions (in particular
4040
* super and protected accessors and instantiation checks) are naturally top-down and
4141
* don't lend themselves to the bottom-up approach of a mini phase. The other two functions
@@ -54,16 +54,16 @@ class PostTyper extends MacroTransform with IdentityDenotTransformer { thisTran
5454

5555
protected def newTransformer(implicit ctx: Context): Transformer =
5656
new PostTyperTransformer
57-
57+
5858
val superAcc = new SuperAccessors(thisTransformer)
5959
val paramFwd = new ParamForwarding(thisTransformer)
6060
val synthMth = new SyntheticMethods(thisTransformer)
61-
61+
6262
private def newPart(tree: Tree): Option[New] = methPart(tree) match {
6363
case Select(nu: New, _) => Some(nu)
6464
case _ => None
6565
}
66-
66+
6767
private def checkValidJavaAnnotation(annot: Tree)(implicit ctx: Context): Unit = {
6868
// TODO fill in
6969
}
@@ -79,28 +79,28 @@ class PostTyper extends MacroTransform with IdentityDenotTransformer { thisTran
7979
tparam.info.asSeenFrom(tycon.tpe.normalizedPrefix, tparam.owner.owner).bounds)
8080
Checking.checkBounds(args, bounds, _.substDealias(tparams, _))
8181
norm(tree)
82-
case _ =>
82+
case _ =>
8383
norm(tree)
84-
}
84+
}
8585
}
8686

8787
class PostTyperTransformer extends Transformer {
88-
88+
8989
private var inJavaAnnot: Boolean = false
90-
90+
9191
private var parentNews: Set[New] = Set()
92-
92+
9393
private def transformAnnot(annot: Tree)(implicit ctx: Context): Tree = {
9494
val saved = inJavaAnnot
9595
inJavaAnnot = annot.symbol is JavaDefined
9696
if (inJavaAnnot) checkValidJavaAnnotation(annot)
9797
try transform(annot)
9898
finally inJavaAnnot = saved
9999
}
100-
100+
101101
private def transformAnnot(annot: Annotation)(implicit ctx: Context): Annotation =
102102
annot.derivedAnnotation(transformAnnot(annot.tree))
103-
103+
104104
private def transformAnnots(tree: MemberDef)(implicit ctx: Context): Unit =
105105
tree.symbol.transformAnnotations(transformAnnot)
106106

@@ -114,7 +114,7 @@ class PostTyper extends MacroTransform with IdentityDenotTransformer { thisTran
114114
superAcc.transformSelect(super.transform(tree), targs)
115115
}
116116
}
117-
117+
118118
override def transform(tree: Tree)(implicit ctx: Context): Tree =
119119
try normalizeTypeTree(tree) match {
120120
case tree: Ident =>
@@ -133,7 +133,7 @@ class PostTyper extends MacroTransform with IdentityDenotTransformer { thisTran
133133
case tree: Template =>
134134
val saved = parentNews
135135
parentNews ++= tree.parents.flatMap(newPart)
136-
try
136+
try
137137
synthMth.addSyntheticMethods(
138138
paramFwd.forwardParamAccessors(
139139
superAcc.wrapTemplate(tree)(

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

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,11 @@ class SuperAccessors(thisTransformer: DenotTransformer) {
4343
* These are value class methods, which will become extension methods.
4444
* (By-name arguments used to be included also, but these
4545
* don't get a new class anymore, they are just wrapped in a new method).
46-
*
46+
*
4747
* These regions will have to be treated specially for the purpose
4848
* of adding accessors. For instance, super calls from these regions
4949
* always have to go through an accessor.
50-
*
50+
*
5151
* The `invalidOwner` field, if different from NoSymbol,
5252
* contains the symbol that is not a valid owner.
5353
*/
@@ -59,10 +59,10 @@ class SuperAccessors(thisTransformer: DenotTransformer) {
5959
try trans
6060
finally invalidEnclClass = saved
6161
}
62-
63-
private def validCurrentClass(implicit ctx: Context): Boolean =
62+
63+
private def validCurrentClass(implicit ctx: Context): Boolean =
6464
ctx.owner.enclosingClass != invalidEnclClass
65-
65+
6666
/** List buffers for new accessor definitions, indexed by class */
6767
private val accDefs = mutable.Map[Symbol, mutable.ListBuffer[Tree]]()
6868

@@ -140,7 +140,7 @@ class SuperAccessors(thisTransformer: DenotTransformer) {
140140
(sym eq Any_##)
141141
}
142142

143-
/** Replace `sel` (or `sel[targs]` if `targs` is nonempty) with a protected accessor
143+
/** Replace `sel` (or `sel[targs]` if `targs` is nonempty) with a protected accessor
144144
* call, if necessary.
145145
*/
146146
private def ensureProtectedAccessOK(sel: Select, targs: List[Tree])(implicit ctx: Context) = {
@@ -204,12 +204,12 @@ class SuperAccessors(thisTransformer: DenotTransformer) {
204204
ctx.debuglog(s"Replaced $sel with $res")
205205
res
206206
}
207-
207+
208208
def isProtectedAccessor(tree: Tree)(implicit ctx: Context): Boolean = tree match {
209209
case Apply(TypeApply(Select(_, name), _), qual :: Nil) => name.isProtectedAccessorName
210210
case _ => false
211211
}
212-
212+
213213
/** Add a protected accessor, if needed, and return a tree that calls
214214
* the accessor and returns the same member. The result is already
215215
* typed.
@@ -225,8 +225,8 @@ class SuperAccessors(thisTransformer: DenotTransformer) {
225225

226226
// if the result type depends on the this type of an enclosing class, the accessor
227227
// has to take an object of exactly this type, otherwise it's more general
228-
val receiverType =
229-
if (isThisType(sym.info.finalResultType)) clazz.thisType
228+
val receiverType =
229+
if (isThisType(sym.info.finalResultType)) clazz.thisType
230230
else clazz.classInfo.selfType
231231
def accTypeOf(tpe: Type): Type = tpe match {
232232
case tpe: PolyType =>
@@ -401,10 +401,10 @@ class SuperAccessors(thisTransformer: DenotTransformer) {
401401
val setter = protectedSetter(lhs)
402402
ctx.debuglog("Replaced " + tree + " with " + setter)
403403
setter.appliedTo(qual, rhs)
404-
}
405-
else tree
404+
}
405+
else tree
406406
}
407-
407+
408408
/** Wrap template to template transform `op` with needed initialization and finalization */
409409
def wrapTemplate(tree: Template)(op: Template => Template)(implicit ctx: Context) = {
410410
accDefs(currentClass) = new mutable.ListBuffer[Tree]
@@ -417,7 +417,7 @@ class SuperAccessors(thisTransformer: DenotTransformer) {
417417
case vd: ValOrDefDef => vd.symbol.flags is ParamAccessor
418418
case _ => false
419419
}
420-
cpy.Template(impl)(body = params ++ accessors ++ rest)
420+
cpy.Template(impl)(body = params ++ accessors ++ rest)
421421
}
422422
}
423423

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,18 +31,18 @@ import scala.language.postfixOps
3131
* def equals(other: Any): Boolean
3232
* def hashCode(): Int
3333
*/
34-
class SyntheticMethods(thisTransformer: DenotTransformer) {
34+
class SyntheticMethods(thisTransformer: DenotTransformer) {
3535
import ast.tpd._
3636

3737
private var myValueSymbols: List[Symbol] = Nil
3838
private var myCaseSymbols: List[Symbol] = Nil
39-
39+
4040
private def initSymbols(implicit ctx: Context) =
4141
if (myValueSymbols.isEmpty) {
4242
myValueSymbols = List(defn.Any_hashCode, defn.Any_equals)
4343
myCaseSymbols = myValueSymbols ++ List(defn.Any_toString, defn.Product_canEqual, defn.Product_productArity)
4444
}
45-
45+
4646
def valueSymbols(implicit ctx: Context) = { initSymbols; myValueSymbols }
4747
def caseSymbols(implicit ctx: Context) = { initSymbols; myCaseSymbols }
4848

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class TypeUtils(val self: Type) extends AnyVal {
2626

2727
def isPrimitiveValueType(implicit ctx: Context): Boolean =
2828
self.classSymbol.isPrimitiveValueClass
29-
29+
3030
def ensureMethodic(implicit ctx: Context): Type = self match {
3131
case self: MethodicType => self
3232
case _ => ExprType(self)

0 commit comments

Comments
 (0)