[
https://issues.apache.org/jira/browse/GROOVY-10369?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Eric Milles updated GROOVY-10369:
---------------------------------
Priority: Minor (was: Major)
> STC does not check the upper bounds of type parameters
> ------------------------------------------------------
>
> Key: GROOVY-10369
> URL: https://issues.apache.org/jira/browse/GROOVY-10369
> Project: Groovy
> Issue Type: Bug
> Components: Static Type Checker
> Reporter: Thodoris Sotiropoulos
> Assignee: Eric Milles
> Priority: Minor
>
> I have the following program
> {code:java}
> class B<T1, T2 extends T1> {}
> class Test {
> public static void main(String[] args) {
> var x = new B<Number, Boolean>();
> }
> }
> {code}
> h3. Actual behaviour
> groovyc accepts and compiles the above program.
> h3. Expected behaviour
> groovyc should have rejected the above program because the second type
> argument at line 6(`Boolean`) is not a subtype of the first one (`Number`).
> Tested against master.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)