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
Make more annotations extend ConstantAnnotation
#9336
Conversation
1102f53
to
5f86f87
Compare
3f5fd92
to
c5d32ba
Compare
I rebased this on top of #9379 and changed both There are a bunch of workarounds required to get this green because the STARR compiler (2.13.4) doesn't yet have the fixes from #9379 and some additional compiler fixes from this PR (extract the To avoid the internal workarounds, we can first merge only the compiler changes but keep There are additional annotations that we should change to extend summon[@SethTisue.type] |
Needs a rebase to not conflict. #9379 is now merged. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Nvm, just realised this is based on a previous version of #9379. Needs a review after rebase.
@BalmungSan #9379 is merged now. Could you rebase this and remove all in the insertions of also the PR title and description need revision now that the scope of the PR has broadened |
30a2d49
to
ee4a705
Compare
@SethTisue let me know if I rebased it correctly, or if I screw it up (I have a backup just in case). About the title, I think it is fine, at the end of the day this PR is just enforcing the use of a literal value for the annotation message and improving the documentation to reflect that. BTW, should I add the same documentation message to Judging from the failed CI, I did screw it up. |
@BalmungSan It seems the story got a bit more tangled than any of us expected. Your original goal here was simply to improve the Let's proceed as follows:
|
@lrytz And before I can do that, I have a question. You wrote:
If I understand correctly, that means that some of the changes to |
Yes, that's right. I'll split up the PR so we can do the changes after the next restarr. |
I was unable to change (Or, we could just remove the auxiliary constructors now, on the grounds that bincompat doesn't matter here since it's compile-time stuff? I've chosen to play it safe, but I don't have a strong opinion about it.) |
ConstantAnnotation
This needs some MiMa excludes and a check file update. I agree to leave |
(now that it's possible to do so, after scala#9463) In this case of e.g. `implicitNotFound`, this makes it clearer that the custom error message must be a literal value. Fixes scala#10424 Co-authored-by: Seth Tisue <seth@tisue.net>
welcome, new Scala contributor! |
it came up in the community build that something like this no longer compiles: @deprecated(
"""|Empty parts are not allowed by the multipart spec, see: https://tools.ietf.org/html/rfc7578#section-4.2
|Moreover, it allows the creation of potentially incorrect multipart bodies
|""".stripMargin,
"0.18.12"
) because using |
@SethTisue note that the annotation was ignored since it wasn't a constant anyways. Thus I would say that a compilation error is good. |
Yes, getting this error is exactly the the goal of this PR |
Otherwise scaladoc will complain in Scala 2.13.6 See scala/scala#9336
Otherwise scaladoc will complain in Scala 2.13.6 See scala/scala#9336 (cherry picked from commit 27a7f83)
This makes it clearer that any custom error messages (e.g. on
implicitNotFound
) must be literal values.Fixes scala/bug#10424