Skip to content

Commit d990e64

Browse files
committed
Cleanup, including removing dead code.
1 parent 3f99915 commit d990e64

File tree

6 files changed

+8
-155
lines changed

6 files changed

+8
-155
lines changed

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,7 @@ class Compiler {
110110
// Note: constructors changes decls in transformTemplate, no InfoTransformers should be added after it
111111
new FunctionalInterfaces, // Rewrites closures to implement @specialized types of Functions.
112112
new Instrumentation) :: // Count closure allocations under -Yinstrument-closures
113-
List(//new LinkScala2Impls, // Redirect calls to trait methods defined by Scala 2.x, so that they now go to
114-
new LambdaLift, // Lifts out nested functions to class scope, storing free variables in environments
113+
List(new LambdaLift, // Lifts out nested functions to class scope, storing free variables in environments
115114
// Note: in this mini-phase block scopes are incorrect. No phases that rely on scopes should be here
116115
new ElimStaticThis, // Replace `this` references to static objects by global identifiers
117116
new CountOuterAccesses) :: // Identify outer accessors that can be dropped

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -380,11 +380,10 @@ object Flags {
380380

381381
/** A module variable (Scala 2.x only)
382382
* /
383-
* A Scala 2.x trait that has been partially augmented.
384-
* This is set in `AugmentScala2Trait` and reset in `LinkScala2Impls`
385-
* when the trait is fully augmented.
383+
* A Scala 2.x trait that has been augmented.
384+
* This is set in `AugmentScala2Trait` when the trait is augmented.
386385
*/
387-
val (_, Scala2ModuleVar @ _, Scala2xPartiallyAugmented @ _) = newFlags(57, "<modulevar>", "<scala-2.x-partially-augmented>")
386+
val (_, Scala2ModuleVar @ _, Scala2xAugmented @ _) = newFlags(57, "<modulevar>", "<scala-2.x-augmented>")
388387

389388
/** A macro */
390389
val (Macro @ _, _, _) = newFlags(58, "<macro>")

compiler/src/dotty/tools/dotc/transform/AugmentScala2Traits.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class AugmentScala2Traits extends MiniPhase with IdentityDenotTransformer { this
3838
val cls = impl.symbol.owner.asClass
3939
for (mixin <- cls.mixins) {
4040
val erasedMixin = TypeErasure.normalizeClass(mixin)
41-
if (erasedMixin.is(Scala2x) && !erasedMixin.is(Scala2xPartiallyAugmented))
41+
if (erasedMixin.is(Scala2x) && !erasedMixin.is(Scala2xAugmented))
4242
augmentScala2Trait(erasedMixin)
4343
}
4444
impl
@@ -49,6 +49,6 @@ class AugmentScala2Traits extends MiniPhase with IdentityDenotTransformer { this
4949
if (sym.isSuperAccessor)
5050
sym.ensureNotPrivate.installAfter(thisPhase)
5151
}
52-
mixin.setFlagFrom(thisPhase, Scala2xPartiallyAugmented)
52+
mixin.setFlagFrom(thisPhase, Scala2xAugmented)
5353
}
5454
}

compiler/src/dotty/tools/dotc/transform/LinkScala2Impls.scala

Lines changed: 0 additions & 129 deletions
This file was deleted.

compiler/src/dotty/tools/dotc/transform/Mixin.scala

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -160,21 +160,6 @@ class Mixin extends MiniPhase with SymTransformer { thisPhase =>
160160
sym
161161
end transformSym
162162

163-
private def initializer(sym: Symbol)(using Context): TermSymbol = {
164-
if (sym.is(Lazy)) sym
165-
else {
166-
val initName = InitializerName(sym.name.asTermName)
167-
sym.owner.info.decl(initName).symbol
168-
.orElse(
169-
newSymbol(
170-
sym.owner,
171-
initName,
172-
Protected | Synthetic | Method,
173-
sym.info,
174-
coord = sym.coord).enteredAfter(thisPhase))
175-
}
176-
}.asTerm
177-
178163
private def wasOneOf(sym: Symbol, flags: FlagSet)(using Context): Boolean =
179164
atPhase(thisPhase) { sym.isOneOf(flags) }
180165

docs/docs/internals/overall-structure.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ phases. The current list of phases is specified in class [Compiler] as follows:
146146
new ElimByName, // Expand by-name parameter references
147147
new CollectNullableFields, // Collect fields that can be nulled out after use in lazy initialization
148148
new ElimOuterSelect, // Expand outer selections
149-
new AugmentScala2Traits, // Augments Scala2 traits with additional members needed for mixin composition.
149+
new AugmentScala2Traits, // Augments Scala2 traits so that super accessors are made non-private
150150
new ResolveSuper, // Implement super accessors
151151
new FunctionXXLForwarders, // Add forwarders for FunctionXXL apply method
152152
new TupleOptimizations, // Optimize generic operations on tuples
@@ -168,8 +168,7 @@ phases. The current list of phases is specified in class [Compiler] as follows:
168168
new Instrumentation, // Count closure allocations under -Yinstrument-closures
169169
new GetClass, // Rewrites getClass calls on primitive types.
170170
new LiftTry) :: // Put try expressions that might execute on non-empty stacks into their own methods their implementations
171-
List(new LinkScala2Impls, // Redirect calls to trait methods defined by Scala 2.x, so that they now go to
172-
new LambdaLift, // Lifts out nested functions to class scope, storing free variables in environments
171+
List(new LambdaLift, // Lifts out nested functions to class scope, storing free variables in environments
173172
// Note: in this mini-phase block scopes are incorrect. No phases that rely on scopes should be here
174173
new ElimStaticThis) :: // Replace `this` references to static objects by global identifiers
175174
List(new Flatten, // Lift all inner classes to package scope

0 commit comments

Comments
 (0)