Daniel Sun created GROOVY-12809:
-----------------------------------
Summary: Compiler: a Java constant used from joint compilation is
still not inlined into a Groovy annotation attribute
Key: GROOVY-12809
URL: https://issues.apache.org/jira/browse/GROOVY-12809
Project: Groovy
Issue Type: Bug
Components: Compiler, Static compilation
Reporter: Daniel Sun
GROOVY-11624 (Closed/Fixed in 5.0.0-beta-1) allowed a statically imported Java
string constant to be used in a Groovy annotation attribute. The remaining test
`bugs.Groovy11624#testConstantInlining2` in
`src/test/groovy/bugs/Groovy11624.groovy` still carries `@NotYetImplemented`.
It jointly compiles a Java class that declares `public static final String
CONST = "value"` with a Groovy script that does `String SINCE = p.A.CONST +
'12345'` and `@Deprecated(since = SINCE)` on a nested interface, then asserts
the annotation value is `value12345`.
Scanned SHA: `ca71425976fd2e3da6db9634955ba0d39550a6d4`.
Re-checked on 22 Nov 2026 (Asia/Taipei) at the same SHA by temporarily removing
@NotYetImplemented and running the test on JDK 17: it still fails. Joint
compilation failed in javac with "element value must be a constant expression"
on @java.lang.Deprecated(since=SINCE). The Java constant is still not inlined
into the Groovy annotation attribute.
**Acceptance criterion:** The joint-compilation script produces an annotation
whose `since` value is the inlined constant expression, and
`@NotYetImplemented` is removed.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)