Daniel Sun created GROOVY-12812:
-----------------------------------

             Summary: STC: @CompileStatic still rejects Functional Java 
HList-style nested generic constructors
                 Key: GROOVY-12812
                 URL: https://issues.apache.org/jira/browse/GROOVY-12812
             Project: Groovy
          Issue Type: Bug
          Components: Static compilation, Static Type Checker
            Reporter: Daniel Sun


GROOVY-6271 (Closed/Fixed, no fixVersion or assignee) reported an 
`@CompileStatic` failure / AIOBE around deeply nested generics. 
`bugs.Groovy6271Bug#testGroovy6271Bug` in 
`src/test/groovy/bugs/Groovy6271Bug.groovy` is still `@NotYetImplemented`. The 
test `@Grab`s `org.functionaljava:functionaljava:3.1` and expects a 
`@CompileStatic` example that builds and appends `HList` / `HCons` / `HAppend` 
values (including `extend(4.0)` and `Integer[]`) to compile. The file comment 
records the current diagnostics: `BigDecimal` inferred where `Double` is 
expected, and a matching `HAppend#append` mismatch.

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. 
@Grab('org.functionaljava:functionaljava:3.1') succeeded; the failure is a 
product STC error, not a Grab failure. Compilation rejected assigning 
HCons<BigDecimal, ...> to HCons<Double, ...> for nil().extend([1, 2] as 
Integer[]).extend("Bar").extend(4.0), and a follow-on HAppend#append(...) call 
failed for the same BigDecimal vs Double mismatch.

**Acceptance criterion:** The example compiles under `@CompileStatic`, and the 
annotation is removed. If Functional Java 3.1 is no longer a desirable 
dependency, rewrite the reproducer with an equivalent local fixture first.



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to