Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.4.7
-
None
Description
Methods like org.codehaus.groovy.runtime.DefaultGroovyMethods.sort(Iterable<T>, boolean, Comparator<T>) and all the others alike should be changed to accept a Comparator<? super T>, otherwise if you use @CompileStatic you'll get compiler errors as soon as you try to sort an Iterable/Collection using a comparator that accept superclass instances.
Attachments
Attachments
Issue Links
- is a clone of
-
GROOVY-7976 Sort methods that accept a comparator should accept Comparator<? super T> (fix DGM signatures)
- Closed
- relates to
-
GROOVY-9803 Static type checker forgets nested generic types
- Closed
-
GROOVY-9998 Wildcards with a lower bound fail static type checking
- Closed
-
GROOVY-9762 Wrong type resolved if method reference used with typed method
- Closed
- links to