Skip to content

Commit fad1838

Browse files
committed
Code refactor
No need to call `atNextPhase` in `transformTemplate`, as the current phase there is already at the end of the miniphase group.
1 parent 526f5df commit fad1838

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

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

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class SpecializedApplyMethods extends MiniPhase with InfoTransformer {
5555

5656
/** Add symbols for specialized methods to FunctionN */
5757
override def transformInfo(tp: Type, sym: Symbol)(using Context) = tp match {
58-
case tp: ClassInfo if defn.isPlainFunctionClass(sym) => {
58+
case tp: ClassInfo if defn.isPlainFunctionClass(sym) =>
5959
sym.name.functionArity match {
6060
case 0 =>
6161
val scope = tp.decls.cloneScope
@@ -72,10 +72,9 @@ class SpecializedApplyMethods extends MiniPhase with InfoTransformer {
7272
specFun2 { (t1, t2, r) => scope.enter(specApplySymbol(sym, List(t1, t2), r)) }
7373
tp.derivedClassInfo(decls = scope)
7474

75-
case _ =>
76-
tp
75+
case _ => tp
7776
}
78-
}
77+
7978
case _ => tp
8079
}
8180

@@ -88,7 +87,7 @@ class SpecializedApplyMethods extends MiniPhase with InfoTransformer {
8887
def synthesizeApply(names: collection.Set[TermName]): Tree = {
8988
val applyBuf = new mutable.ListBuffer[DefDef]
9089
names.foreach { name =>
91-
val applySym = atNextPhase(cls.info.decls.lookup(name))
90+
val applySym = cls.info.decls.lookup(name)
9291
val ddef = DefDef(
9392
applySym.asTerm,
9493
{ vparamss =>

0 commit comments

Comments
 (0)