[ 
https://issues.apache.org/jira/browse/GROOVY-12714?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Daniel Sun resolved GROOVY-12714.
---------------------------------
    Resolution: Fixed

Fixed by #3246 (squash merge 2896afde on master); 6.0.x cherry-pick in progress.

> `@CompileStatic` PECS wildcard containment diverges from javac (JLS 4.5.1)
> --------------------------------------------------------------------------
>
>                 Key: GROOVY-12714
>                 URL: https://issues.apache.org/jira/browse/GROOVY-12714
>             Project: Groovy
>          Issue Type: Bug
>          Components: Static Type Checker
>            Reporter: Daniel Sun
>            Priority: Major
>             Fix For: 7.0.0-alpha-1, 6.0.1
>
>
> h2. Problem
> Under {{@CompileStatic}}, Groovy's generics / wildcard containment was more 
> permissive than javac for several JLS 4.5.1 PECS cases, including:
> * adding a non-subtype into {{List<? super Integer>}} (e.g. {{add(Double)}})
> * treating {{? extends Number}} as contained in {{? extends Integer}} (and 
> the dual lower-bound mistake)
> * assigning a wildcard producer {{List<? extends Number>}} to an invariant 
> {{List<Number>}}
> h2. Fix
> Align containment and capture write checks with JLS SE 25 ยงยง4.5.1, 4.5.2, 
> 4.10.2, 5.1.10 so {{@CompileStatic}} matches javac.
> h2. Tests
> Extend {{gls.generics.GenericsJavaCompatibilityTest}} with PECS containment / 
> transfer / negative cases that both compilers must agree on.
> h2. PR
> https://github.com/apache/groovy/pull/3246



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

Reply via email to