-
Notifications
You must be signed in to change notification settings - Fork 1.1k
given swallows inline errors #9014
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
Comments
I would like to give this a go if at all possible? I think the part which needs to be changed is Implicits.scala, where the error is dropped. EDIT. We do see an error in the Since it feels as though it's a deliberate decision to drop the errors, I'm not entirely sure what to do. |
Minimized to trait Bar
inline given as Bar = compiletime.error("Failed to expand!")
val tests = summon[Bar] The issue is that when looking for implicits, if an error is reported then implicit disregard this implicit and tries to find another one. This leads to some interaction between error reporting in the |
I see. Something I didn't quite understand is that the tree created by the macro appears in the error message (so I actually used that for debugging purposes). If there was another implicit it could try would that still be the case or does the implicit search just stop there? |
Interesting. Then it looks like this issue is mostly about reporting. The first step should be to track and understand which reporter receives the macro error and which prints the actual error. |
import scala.quoted._
trait Bar
inline given as Bar = ${ impl }
def impl(using qctx: QuoteContext): Expr[Bar] = qctx.throwError("Failed to expand!") val tests = summon[Bar] |
This it is possible to copy/paste the original call that failed and get the error message.
Fix #9014: On implicit search failure print original inline call
Uh oh!
There was an error while loading. Please reload this page.
Minimized example
Output
Expectation
Ideally, the macro expansion should show the
qctx.error
.The text was updated successfully, but these errors were encountered: