[ https://issues.apache.org/jira/browse/GROOVY-11401?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Eric Milles updated GROOVY-11401: --------------------------------- Affects Version/s: 5.0.0-alpha-8 > STC: inferred type of name within closure (delegate property versus owner > field) > -------------------------------------------------------------------------------- > > Key: GROOVY-11401 > URL: https://issues.apache.org/jira/browse/GROOVY-11401 > Project: Groovy > Issue Type: Bug > Components: Static Type Checker > Affects Versions: 3.0.21, 5.0.0-alpha-8, 4.0.21 > Reporter: Eric Milles > Assignee: Eric Milles > Priority: Major > Fix For: 3.0.22, 4.0.22 > > > Consider the following: > {code:groovy} > class C { > private Object obj = 'field' > @groovy.transform.TypeChecked > void test() { > Map<String,String> map = [:].withDefault{ 'entry' } > map.with { > def x = obj > print x > } > } > } > new C().test() > {code} > This script prints "entry" but the inferred type of "x" is {{Object}} not > {{String}}. > GROOVY-11367 -- This message was sent by Atlassian Jira (v8.20.10#820010)