Skip to content

Fix #3853 and #4151: Compile code in the macro definition and remove interpreter #4155

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 5 commits into from
Mar 29, 2018
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
222 changes: 0 additions & 222 deletions compiler/src/dotty/tools/dotc/interpreter/Interpreter.scala

This file was deleted.

7 changes: 6 additions & 1 deletion compiler/src/dotty/tools/dotc/transform/PostTyper.scala
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,12 @@ class PostTyper extends MacroTransform with IdentityDenotTransformer { thisPhase
// be duplicated
// 2. To enable correct pickling (calls can share symbols with the inlined code, which
// would trigger an assertion when pickling).
val callTrace = Ident(call.symbol.topLevelClass.typeRef).withPos(call.pos)
// In the case of macros we keep the call to be able to reconstruct the parameters that
// are passed to the macro. This same simplification is applied in ReifiedQuotes when the
// macro splices are evaluated.
val callTrace =
if (call.symbol.is(Macro)) call
else Ident(call.symbol.topLevelClass.typeRef).withPos(call.pos)
cpy.Inlined(tree)(callTrace, transformSub(bindings), transform(expansion))
case tree: Template =>
withNoCheckNews(tree.parents.flatMap(newPart)) {
Expand Down
Loading