Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.3.6, 2.4.5
-
None
Description
In this example:
import groovy.transform.TypeChecked doIt() @TypeChecked void doIt() { List<Integer> nums = [1, 2, 3, -2, -5, 6] // nums.sort { a, b -> a.abs() <=> b.abs() } Collections.sort(nums, { a, b -> a.abs() <=> b.abs() }) }
the type checking fails on the closure arguments (no method abs() on type Object). Interestingly, it works fine for the line that's commented out.