Skip to content

Fix #10355: Run PostTyper before Staging in REPL #10995

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 4, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions compiler/src/dotty/tools/dotc/transform/Staging.scala
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ class Staging extends MacroTransform {

override def phaseName: String = Staging.name

override def runsAfter: Set[String] = Set(PostTyper.name)

override def allowsImplicitSearch: Boolean = true

override def checkPostCondition(tree: Tree)(using Context): Unit =
Expand Down
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/repl/ReplCompiler.scala
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ class ReplCompiler extends Compiler {
override protected def frontendPhases: List[List[Phase]] = List(
List(new REPLFrontEnd),
List(new CollectTopLevelImports),
List(new PostTyper),
List(new Staging),
List(new PostTyper)
)

def newRun(initCtx: Context, state: State): Run = new Run(this, initCtx) {
Expand Down
5 changes: 5 additions & 0 deletions compiler/test-resources/repl/i10355
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
scala> import scala.quoted._
scala> def foo(expr: Expr[Any])(using Quotes) = expr match { case '{ $x: t } => '{ $x: Any } }
def foo(expr: quoted.Expr[Any])(using x$2: quoted.Quotes): quoted.Expr[Any]
scala> def bar(expr: Expr[Any])(using Quotes) = expr match { case '{ $x: t } => '{ val a: t = ??? ; ???} }
def bar(expr: quoted.Expr[Any])(using x$2: quoted.Quotes): quoted.Expr[Nothing]