Skip to content
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

Let inlining report compiletime.error text #22561

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

som-snytt
Copy link
Contributor

After typer, add error diagnostics to a special LateMismatchedImplicit, so that inlining can add the text to the "missing arg" message. (It piggy-backs on the otherwise unused "location" string. The existing English grammar works out okay.) This limits the "surface area" of this channel.

The current reference does not suggest that error works only at typer phase:

The error method is used to produce user-defined compile errors during inline expansion.

The reference is liberal about how the user text is represented:

If an inline expansion results in a call error(msgStr) the compiler produces an error message containing the given msgStr.

This commit is more conservative than nicolasstucki's fix for macro errors, since existing clients can ignore the special MismatchedImplicit type, and msg formatting is unchanged.

Fixes #15788

@som-snytt som-snytt force-pushed the issue/15788-compiletime-error-inlined branch from 0c6ad6f to 226cd1d Compare February 10, 2025 01:52
@som-snytt som-snytt marked this pull request as ready for review February 10, 2025 01:58
@som-snytt som-snytt force-pushed the issue/15788-compiletime-error-inlined branch from 226cd1d to e6cd09f Compare February 13, 2025 03:53
@Gedochao Gedochao requested review from dwijnand and jchyb February 14, 2025 07:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Inconsistent summonInline behavior
2 participants