Skip to content

Commit 5f87089

Browse files
committed
Document why patternMatcher needs to be after tailrec.
1 parent cb18aa3 commit 5f87089

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/dotty/tools/dotc/Compiler.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ class Compiler {
5757
new TailRec),
5858
List(new PatternMatcher,
5959
new ExplicitOuter,
60-
new LazyValTranformContext().transformer, // disabled, awaiting fixes
60+
new LazyValTranformContext().transformer,
6161
new Splitter),
6262
List(new ElimByName,
6363
new InterceptedMethods,

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import core.StdNames._
1212
import dotty.tools.dotc.ast.{TreeTypeMap, tpd}
1313
import dotty.tools.dotc.core
1414
import dotty.tools.dotc.core.DenotTransformers.DenotTransformer
15+
import dotty.tools.dotc.core.Phases.Phase
1516
import dotty.tools.dotc.core.{TypeApplications, Flags}
1617
import dotty.tools.dotc.typer.Applications
1718
import dotty.tools.dotc.util.Positions
@@ -41,6 +42,8 @@ class PatternMatcher extends MiniPhaseTransform with DenotTransformer {thisTrans
4142

4243
override def runsAfter = Set(classOf[ElimRepeated])
4344

45+
override def runsAfterGroupsOf = Set(classOf[TailRec]) // tailrec is not capable of reversing the patmat tranformation made for tree
46+
4447
override def phaseName = "patternMatcher"
4548

4649
var _id = 0

0 commit comments

Comments
 (0)