Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.2.2
-
None
-
None
Description
The following code fails with master:
static BigInteger iterative(final BigInteger n) { validateParameter(n) BigInteger total = 1G if (n > 1) { (2G..n).each{BigInteger i -> total *= i } } total }
The reason is that the inferred type of the big integer range is not Range<BigInteger> but the concrete type ObjectRange. Unfortunately, this type is not generified in the Groovy codebase and can't be without breaking binary compatibility.
As a workaround, the inferred type should be Range<BigInteger.