You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Eric Milles (Jira)" <ji...@apache.org> on 2021/10/06 19:48:00 UTC
[jira] [Resolved] (GROOVY-6987) Collecting lists loses type
information for a list of lists
[ https://issues.apache.org/jira/browse/GROOVY-6987?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Eric Milles resolved GROOVY-6987.
---------------------------------
Resolution: Fixed
> Collecting lists loses type information for a list of lists
> -----------------------------------------------------------
>
> Key: GROOVY-6987
> URL: https://issues.apache.org/jira/browse/GROOVY-6987
> Project: Groovy
> Issue Type: Bug
> Components: Static Type Checker
> Affects Versions: 2.3.6
> Environment: Gradle 2.0, Java 1.8.0_05, Windows 7, Groovy 2.3.6
> Reporter: Mark Perry
> Priority: Major
>
> The following code does not type check, but should:
> {code}
> @Test
> void testCollect() {
> def list = [[1]].collect { List<Integer> list ->
> // the following line type checks
> Math.abs((Integer) list[0])
> // the following line does not type check, but should
> Math.abs(list[0])
> }
> println list
> }
> {code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)