Skip to content

Failed compile when Java annotation used as parameter of another Java annotation #19959

Closed as not planned
@wiwiwa

Description

@wiwiwa

Compiler version

Scala 3.3 and 3.4

Minimized code

//> using scala 3.4.0
//> using dep "jakarta.persistence:jakarta.persistence-api:3.1.0"

import jakarta.persistence.*

@Table(indexes=Array(Index(columnList="email")))
class User

Output

$ scala-cli run test.scala
Compiling project (Scala 3.4.0, JVM (20))
[error] ./test.scala:6:22
[error] object Index in package jakarta.persistence does not take parameters
[error] @Table(indexes=Array(Index(columnList="email")))
[error]                      ^^^^^
Error compiling project (Scala 3.4.0, JVM (20))
Compilation failed

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions