[ https://issues.apache.org/jira/browse/GROOVY-10153?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Eric Milles resolved GROOVY-10153. ---------------------------------- Resolution: Information Provided > STC: cannot combine use-variance with bounded polymorphism > ---------------------------------------------------------- > > Key: GROOVY-10153 > URL: https://issues.apache.org/jira/browse/GROOVY-10153 > Project: Groovy > Issue Type: Bug > Components: Static compilation, Static Type Checker > Affects Versions: 4.0.0-alpha-3 > Reporter: Stefanos Chaliasos > Assignee: Eric Milles > Priority: Major > > I have the following Groovy program. > {code:groovy} > @groovy.transform.TypeChecked > class Test { > public void m() { > Foo<? super C> x = new Foo<B>(); > } > } > class A {} > class B extends A {} > class C extends B {} > class Foo<T extends A> { > } > {code} > h2. Actual Behavior > The program does not compile, and I get the following error. > {code:java} > org.codehaus.groovy.control.MultipleCompilationErrorsException: startup > failed: > Test.groovy: 4: The type ? is not a valid substitute for the bounded > parameter <T extends A> > @ line 4, column 9. > Foo<? super C> x = new Foo<B>(); > ^ > 1 error > {code} > h2. Expected Behavior > Compile successfully. -- This message was sent by Atlassian Jira (v8.20.7#820007)