[
https://issues.apache.org/jira/browse/GROOVY-10002?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Eric Milles updated GROOVY-10002:
---------------------------------
Fix Version/s: 2.5.22
> STC: inconsistent support for assignment of list literals
> ---------------------------------------------------------
>
> Key: GROOVY-10002
> URL: https://issues.apache.org/jira/browse/GROOVY-10002
> Project: Groovy
> Issue Type: Bug
> Reporter: Eric Milles
> Assignee: Eric Milles
> Priority: Major
> Fix For: 4.0.0-alpha-3, 3.0.15, 2.5.22
>
> Time Spent: 0.5h
> Remaining Estimate: 0h
>
> Consider the following:
> {code:groovy}
> @groovy.transform.TypeChecked
> void test() {
> List<String> a = [] // okay
> Set<String> b = [] // okay
> Deque<String> c = [] // GroovyCastException at runtime
> Deque<String> d = [1,2,3] // error for unknown constructor (interfaces
> don't have them) and error for incompatible generics
> ArrayDeque<String> e = [123] // ArrayDeque(int numElements); error for
> incompatible generics (bad)
> Set<String> f = ['foo', 'bar', 'foo'] // error for unknown constructor
> (castToType would handle this at runtime if allowed) and error for
> incompatible generic types (wrong)
> }
> {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)