Skip to content

Commit e635705

Browse files
Merge pull request #10995 from dotty-staging/fix-#10355
Fix #10355: Run PostTyper before Staging in REPL
2 parents d1bb8d3 + 3ecfc57 commit e635705

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ class Staging extends MacroTransform {
3535

3636
override def phaseName: String = Staging.name
3737

38+
override def runsAfter: Set[String] = Set(PostTyper.name)
39+
3840
override def allowsImplicitSearch: Boolean = true
3941

4042
override def checkPostCondition(tree: Tree)(using Context): Unit =

compiler/src/dotty/tools/repl/ReplCompiler.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ class ReplCompiler extends Compiler {
3434
override protected def frontendPhases: List[List[Phase]] = List(
3535
List(new REPLFrontEnd),
3636
List(new CollectTopLevelImports),
37+
List(new PostTyper),
3738
List(new Staging),
38-
List(new PostTyper)
3939
)
4040

4141
def newRun(initCtx: Context, state: State): Run = new Run(this, initCtx) {

compiler/test-resources/repl/i10355

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
scala> import scala.quoted._
2+
scala> def foo(expr: Expr[Any])(using Quotes) = expr match { case '{ $x: t } => '{ $x: Any } }
3+
def foo(expr: quoted.Expr[Any])(using x$2: quoted.Quotes): quoted.Expr[Any]
4+
scala> def bar(expr: Expr[Any])(using Quotes) = expr match { case '{ $x: t } => '{ val a: t = ??? ; ???} }
5+
def bar(expr: quoted.Expr[Any])(using x$2: quoted.Quotes): quoted.Expr[Nothing]

0 commit comments

Comments
 (0)