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

java annotation Array constants have to be specified using the Array(...) factory method 2.13.3 #12133

Closed
stephennancekivell opened this issue Aug 28, 2020 · 4 comments

Comments

@stephennancekivell
Copy link

stephennancekivell commented Aug 28, 2020

I have some java classes that have annotations that are now crashing after upgrading to 2.13.3

reproduction steps

Using Scala 2.13.3, but its a java file.

@Entity
@Table(name = "portal", uniqueConstraints = @UniqueConstraint(columnNames = {"account_id_fk", "name"}))
...

problem

Array constants have to be specified using the `Array(...)` factory method
@Table(name = "portal", uniqueConstraints = @UniqueConstraint(columnNames = {"account_id_fk", "name"}))

I expect this to compile like it did in 2.13.2.

If I try the suggestion it doesnt work, just say the next line is illegal eg, illegal start of type declaration

@Entity
@Table(name = "portal", uniqueConstraints = @UniqueConstraint(columnNames = Array("account_id_fk", "name")))
...

This seems like it might be related to scala/scala#8781

edit: I should mention these annotations are from javax.persistence

Thanks

@SethTisue
Copy link
Member

@dwijnand ?

@stephennancekivell
Copy link
Author

Hi @dwijnand Im still getting the same error in a recent 2.13.4 snapshot.

I see your fix has been merged into 2.12 but I'm not familiar with how it should get into the 2.13 branch. How should that happen.

I've put together a minimal reproduction here https://github.com/stephennancekivell/scala-12133

Thanks
image

@som-snytt
Copy link

@stephennancekivell there is a "merge forward" PR in flight scala/scala#9206

@stephennancekivell
Copy link
Author

Oh, thanks for explaining @som-snytt, that makes sense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants