Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.2.1
-
None
-
None
Description
The problem is highlighted with Java 8, where a Collection.sort(Comparator) method has been added. Given the following code:
list.sort { a,b -> a<=>b }
which takes a closure, then the type checker chooses the default method from Collection, Collection.sort(Comparator) because an implicit coercion of Closure to Comparator is possible.
However, there's a DGM#sort(Collection,Closure) method which should have been preferred.
The result is a build failure as seen in http://148.251.23.208:8111/viewLog.html?buildId=35&tab=buildResultsDiv&buildTypeId=Groovy_Jdk8Build