Unused warnings: for macros, by default, look for usages in expansion#10693
Conversation
c2a6c08 to
4a77a23
Compare
|
The missing interpolator lint should be in refchecks. The new motivation is that it only warns when the literal is typechecked, not after macro expansion. Since refchecks can check the expandee, it can warn more consistently. |
4a77a23 to
b638a21
Compare
|
@som-snytt (now that we have an approval from Lukas, let's turn to the matter of documentation) is there migration advice that could be in the PR description? as in, I am a Scala user, what do I do now? |
That is what everyone is asking themselves. Let me know the results of the next community build. |
|
I wonder if this PR ever saw that community build. I updated the description to include the "missing interpolator" lint seen by some users of assert macros. |
By default,
-Wunusedcan be satisfied by a usage introduced by a macro expansion.This is the revised behavior under
-Wmacros:default. Previously, the default setting was-Wmacros:before, to lint only before any macros are expanded. The new behavior may reduce the need to suppress warnings.Previously,
-Wmacros:aftercould be used to lint only the expansion, but if the expansion introduces more unused definitions, then those will generate warnings under that mode.Note that linting the macro expansion will also warn for
-Xlint:missing-interpolator, since 2.13.14. Macros for test assertions that capture interpolations as regular string literals will warn. For example, if a macro transformsinto
Fixes scala/bug#12953