[
https://issues.apache.org/jira/browse/GROOVY-10999?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Eric Milles updated GROOVY-10999:
---------------------------------
Priority: Minor (was: Major)
> Unexpected type mismatch when having bounded type parameters
> ------------------------------------------------------------
>
> Key: GROOVY-10999
> URL: https://issues.apache.org/jira/browse/GROOVY-10999
> Project: Groovy
> Issue Type: Bug
> Components: Static Type Checker
> Reporter: Thodoris Sotiropoulos
> Priority: Minor
>
> This might be related to GROOVY-10629.
> I have the following program:
> {code}
> class Main {
> static final <U extends Number, H extends U> void test() {
> def x = java.util.Collections.<H, H>emptyNavigableMap().ceilingKey((H)
> null);
> }
> }
> {code}
> h3. Actual behavior
> {code}
> org.codehaus.groovy.control.MultipleCompilationErrorsException: startup
> failed:
> Main.groovy: 3: [Static type checking] - Cannot call
> java.util.NavigableMap#ceilingKey(H) with arguments [H]
> @ line 3, column 13.
> def x = java.util.Collections.<H, H>emptyNavigableMap().ceilingKey((H)
> null);
> ^
> 1 error
> {code}
> h3. Expected behavior
> Compile successfully
> Tested against master (commit: 72cae725137e3a610b94e6927b18587c439f6f9b)
--
This message was sent by Atlassian Jira
(v8.20.10#820010)