Daniel Sun created GROOVY-12819:
-----------------------------------
Summary: STC: property access on Class<T> is not resolved for an
intersection bound with a static member
Key: GROOVY-12819
URL: https://issues.apache.org/jira/browse/GROOVY-12819
Project: Groovy
Issue Type: Bug
Components: Static compilation, Static Type Checker
Reporter: Daniel Sun
GROOVY-6919 (Closed/Fixed) made static compilation work with multiple-bounds
generics for instance property reads.
`GenericsSTCTest#testMethodLevelGenericsForPropertyRead2` in
`src/test/groovy/groovy/transform/stc/GenericsSTCTest.groovy` has no issue key
and is still `@NotYetImplemented`. It takes `Class<T>` where `T extends I1 &
I2`, `I1` has `static String getFoo()`, `I2` has `String bar = 'bar'`, and then
reads `cls?.foo` and `cls?.bar`.
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. STC reports
"No such property: foo for class: java.lang.Class" at cls?.foo and "No such
property: bar for class: java.lang.Class" at cls?.bar. Property access on
Class<T> is still not resolved for an intersection bound with a static member.
**Acceptance criterion:** Both property reads type-check on `Class<T>`, the
test passes, and the annotation is removed.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)