Skip to content

Align the spec (and write it) and the checks for @targetName #22372

Open
@hamzaremmal

Description

@hamzaremmal

Compiler version

312c89a

Minimized example

@annotation.targetName("foo" + "bar") def foo = ???

Output

-- Error: ----------------------------------------------------------------------
1 |@annotation.targetName("foo" + "bar") def foo = ???
  |                       ^^^^^^^^^^^^^
  |                       @targetName needs a string literal as argument
1 error found

Expectation

Should compile. The spec says (should say actually) that the parameter of an @targetName annotation should be a constant expression.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions