[ https://issues.apache.org/jira/browse/GROOVY-10371?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Eric Milles resolved GROOVY-10371. ---------------------------------- Fix Version/s: 5.0.0-alpha-12 Resolution: Fixed https://github.com/apache/groovy/blob/71490fbbc2dc63cdaa70b2f61b77f7f5f94b82af/src/test/groovy/transform/stc/GenericsSTCTest.groovy#L1949 > STC involves improper subtyping rules for parameterized types with wildcard > types > --------------------------------------------------------------------------------- > > Key: GROOVY-10371 > URL: https://issues.apache.org/jira/browse/GROOVY-10371 > Project: Groovy > Issue Type: Bug > Components: Static Type Checker > Reporter: Thodoris Sotiropoulos > Assignee: Eric Milles > Priority: Minor > Fix For: 5.0.0-alpha-12 > > > The following program should not type check > {code:java} > class A<T> {} > class B<T> extends A<T> {} > class Test { > B<? extends Number> x = new B<Double>(); > A<Number> y = x; > } > {code} > h3. Expected behaviour > the compiler should have rejected the program and produced an error of the > form (like javac does): > {code} > error: incompatible types: B<CAP#1> cannot be converted to A<Number> > A<Number> y = x; > ^ > where CAP#1 is a fresh type-variable: > CAP#1 extends Number from capture of ? extends Number > 1 error > {code} > Tested against master -- This message was sent by Atlassian Jira (v8.20.10#820010)