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
The logging will only be triggered if the macro function (in this case EmitMsg.emit) was called directly, if it is called as part of an implicit macros pattern (https://docs.scala-lang.org/overviews/macros/implicits.html), it will be ignored. Namely, all error message degrades to "implicit not found" message, and all info & warning message won't be logged or displayed anywhere.
problem
Give the ubiquity of implicit macros pattern, this issue may seriously degrade the capability of macro system.
This issue is also blocking my PR for singleton-ops:
@som-snytt Thanks a lot, I can't find in the post which mentioned macro anywhere (or compilet-time context warning/info). It may be possible to merge these 2 issues into one, as the "shading" of error message could happen twice in a row:
type-mismatch error shading implicit not found error
implicit not found error shading macro context error
dwijnand
changed the title
All logging functions in scala.reflection.macros.FrontEnds doesn't work in implicit macros pattern
All logging functions in scala.reflect.macros.FrontEnds doesn't work in implicit macros pattern
Jun 4, 2021
dwijnand
changed the title
All logging functions in scala.reflect.macros.FrontEnds doesn't work in implicit macros pattern
All logging functions in scala.reflect.macros.FrontEnds don't work in implicit macros pattern
Jun 4, 2021
reproduction steps
Main example:
https://stackoverflow.com/questions/67328769/in-scala-2-13-how-to-log-information-warning-error-reliably-in-macro
using Scala 2.13.5, if you use any macro logging function in a macro, e.g.
The logging will only be triggered if the macro function (in this case EmitMsg.emit) was called directly, if it is called as part of an implicit macros pattern (https://docs.scala-lang.org/overviews/macros/implicits.html), it will be ignored. Namely, all error message degrades to "implicit not found" message, and all info & warning message won't be logged or displayed anywhere.
problem
Give the ubiquity of implicit macros pattern, this issue may seriously degrade the capability of macro system.
This issue is also blocking my PR for singleton-ops:
fthomas/singleton-ops#186
The text was updated successfully, but these errors were encountered: