Skip to content

Commit a73d29a

Browse files
committed
Performance tweak (thanks @smarter)
1 parent d1ea601 commit a73d29a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,12 @@ class SpecializeFunctions extends MiniPhase with InfoTransformer {
1616
val phaseName = "specializeFunctions"
1717
override def runsAfter = Set(ElimByName.name)
1818

19+
override def infoMayChange(sym: Symbol)(using Context): Boolean =
20+
!sym.is(Flags.Package) && sym.isDefinedInCurrentRun
21+
1922
/** Transforms the type to include decls for specialized applys */
2023
override def transformInfo(tp: Type, sym: Symbol)(using Context) = tp match {
21-
case tp: ClassInfo if !sym.is(Flags.Package) =>
24+
case tp: ClassInfo =>
2225
val newApplys = new mutable.ListBuffer[Symbol]
2326

2427
var arity = 0

0 commit comments

Comments
 (0)