-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Failed compile when Java annotation used as parameter of another Java annotation #19959
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
Ok, so this is weird... So far I didn't manage to minimise it, despite the code from However, I wonder if it's a valid bug in the first place. //> using scala 3.4.0
//> using dep "jakarta.persistence:jakarta.persistence-api:3.1.0"
import jakarta.persistence.Index
import jakarta.persistence.Table
@Table(indexes=Array(new Index(columnList="email")))
class User So the |
@sjrd Would you consider this a valid regression? |
You're not supposed to need a |
Yes. Adding a |
using local java sources, 3.2.2 also fails to compile.
using
makes it compile, which is obviously a bug or limitation. Nothing works on 3.3.3 or 3.4 except Outside of annotation context, 3.2.2 crashes:
but 3.3 emits normal error. That edit of Scala 2 spec on annotations isn't ported yet, but then perhaps "Host-platform Annotations" could be updated. Currently it says it should just work, unless it doesn't.
probably doesn't intend to say that you have to use Not sure how incremental compilation faked out javac here:
|
This was actually an intended change, quoting from 3125665 :
Given that the current encoding of constructors with annotations is already causing us headaches (#19951 (comment)), it's probably wiser to not make things more complicated by adding constructor proxies in the mix, at least not until #19951 has been fixed. |
Okay, so this is blocked by #19951. |
Compiler version
Scala 3.3 and 3.4
Minimized code
Output
Expectation
The code compiles with Scala <= 3.2, but does not compile with higher version of Scala. Expected to be working with Scala 3.4
The text was updated successfully, but these errors were encountered: