You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
detect missing class file for classpath dependency in macro
Previously, it was assumed that a missing class (that is valid in current run)
during macro evaluation was due to the symbol being defined in the same project.
If this condition is met, then compilation is suspended.
This assumption breaks when the symbol comes from the classpath, but without a
corresponding class file, leading a situation where the same file is always suspended,
until it is the only one left, leading to the "cyclic macro dependencies" error.
In this case we should assume that the class file will never become available because class path entries
are supposed to be immutable. Therefore we should not suspend in this case.
This commit therefore detects this situation. Instead of suspending the unit,
the compiler aborts the macro expansion, reporting an error that
the user will have to deal with - likely by changing the build definition
Copy file name to clipboardExpand all lines: compiler/src/dotty/tools/dotc/transform/MacroAnnotations.scala
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -107,8 +107,8 @@ class MacroAnnotations(phase: IdentityDenotTransformer):
107
107
if!ctx.reporter.hasErrors then
108
108
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.", annot.tree)
0 commit comments