Skip to content

Commit

Permalink
Use ??? instead of EmptyTree for StopMacroExpansion.
Browse files Browse the repository at this point in the history
  • Loading branch information
dwijnand committed Mar 5, 2024
1 parent 44aa3c6 commit 0fe0490
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/inlines/Inlines.scala
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ object Inlines:
// different for bindings from arguments and bindings from body.
val inlined = tpd.Inlined(call, bindings, expansion)

if !hasOpaqueProxies || !inlined.tpe.exists then inlined
if !hasOpaqueProxies then inlined
else
val target =
if inlinedMethod.is(Transparent) then call.tpe & inlined.tpe
Expand Down
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/transform/Splicer.scala
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ object Splicer {
if !ctx.reporter.hasErrors then
report.error("Macro expansion was aborted by the macro without any errors reported. Macros should issue errors to end-users when aborting a macro expansion with StopMacroExpansion.", splicePos)
// errors have been emitted
EmptyTree
ref(defn.Predef_undefined).withType(ErrorType(em"macro expansion was stopped"))
case ex: StopInterpretation =>
report.error(ex.msg, ex.pos)
ref(defn.Predef_undefined).withType(ErrorType(ex.msg))
Expand Down
2 changes: 1 addition & 1 deletion tests/neg-macros/i9014b.check
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
|
| given_Bar
|
| But given instance given_Bar does not match type Bar.
| But macro expansion was stopped.

0 comments on commit 0fe0490

Please sign in to comment.