|
1 | 1 | package dotty.tools.dotc
|
2 | 2 | package transform
|
3 | 3 |
|
4 |
| -import TreeTransforms.{ MiniPhaseTransform, TransformerInfo } |
5 | 4 | import ast.Trees._, ast.tpd, core._
|
6 | 5 | import Contexts.Context, Types._, Decorators._, Symbols._, DenotTransformers._
|
7 | 6 | import SymDenotations._, Scopes._, StdNames._, NameOps._, Names._
|
| 7 | +import MegaPhase.MiniPhase |
8 | 8 |
|
9 | 9 | import scala.collection.mutable
|
10 | 10 |
|
11 | 11 | /** Specializes classes that inherit from `FunctionN` where there exists a
|
12 | 12 | * specialized form.
|
13 | 13 | */
|
14 |
| -class SpecializeFunctions extends MiniPhaseTransform with InfoTransformer { |
| 14 | +class SpecializeFunctions extends MiniPhase with InfoTransformer { |
15 | 15 | import ast.tpd._
|
16 | 16 | val phaseName = "specializeFunctions"
|
17 | 17 | override def runsAfter = Set(classOf[ElimByName])
|
18 | 18 |
|
19 | 19 | /** Transforms the type to include decls for specialized applys */
|
20 |
| - def transformInfo(tp: Type, sym: Symbol)(implicit ctx: Context) = tp match { |
| 20 | + override def transformInfo(tp: Type, sym: Symbol)(implicit ctx: Context) = tp match { |
21 | 21 | case tp: ClassInfo if !sym.is(Flags.Package) && (tp.decls ne EmptyScope) =>
|
22 | 22 | var newApplys = Map.empty[Name, Symbol]
|
23 | 23 |
|
@@ -59,7 +59,7 @@ class SpecializeFunctions extends MiniPhaseTransform with InfoTransformer {
|
59 | 59 | * generic applys to the specialized ones. Also inserts the specialized applys
|
60 | 60 | * in the template body.
|
61 | 61 | */
|
62 |
| - override def transformTemplate(tree: Template)(implicit ctx: Context, info: TransformerInfo) = { |
| 62 | + override def transformTemplate(tree: Template)(implicit ctx: Context) = { |
63 | 63 | val applyBuf = new mutable.ListBuffer[Tree]
|
64 | 64 | val newBody = tree.body.mapConserve {
|
65 | 65 | case dt: DefDef if dt.name == nme.apply && dt.vparamss.length == 1 =>
|
@@ -97,7 +97,7 @@ class SpecializeFunctions extends MiniPhaseTransform with InfoTransformer {
|
97 | 97 | }
|
98 | 98 |
|
99 | 99 | /** Dispatch to specialized `apply`s in user code when available */
|
100 |
| - override def transformApply(tree: Apply)(implicit ctx: Context, info: TransformerInfo) = |
| 100 | + override def transformApply(tree: Apply)(implicit ctx: Context) = |
101 | 101 | tree match {
|
102 | 102 | case Apply(fun, args)
|
103 | 103 | if fun.symbol.name == nme.apply &&
|
|
0 commit comments