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
Fix #12656 by setting the proper reporter for inlined methods #13543
Conversation
@nicolasstucki I get a pickling test diff:
Not sure what to do with this. |
You can add it to |
Co-authored-by: Nicolas Stucki <nicolas.stucki@gmail.com>
I've discovered that this issue hid another bug. It seems that when an implicit macro issues an error message, a non-transparent inline function wrapper fails to pick it up. If the function is transparent, then it works as expected: trait MacroErr
object MacroErr:
import scala.quoted.*
inline given MacroErr = ${ macroErr }
def macroErr(using Quotes): Expr[MacroErr] =
import quotes.reflect.*
'{ compiletime.error("some macro error") } inline def expectCompileError(
inline code: String,
expectedMsg: String
) =
val errors = compiletime.testing.typeCheckErrors(code)
assert(errors.head.message == expectedMsg, (errors.head.message, expectedMsg))
@main def Test = expectCompileError("""summon[MacroErr]""", "some macro error")
What do you think @nicolasstucki, should I file this as a separate issue and we let this one be merged as-is, or should we investigate further why non-transparent inline method wrappers fail in this particular area? |
File it as a separate issue. |
Can we merge this? |
Fixes #12656