[ https://issues.apache.org/jira/browse/GROOVY-11387?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17850102#comment-17850102 ]
Eric Milles edited comment on GROOVY-11387 at 6/24/24 7:36 PM: --------------------------------------------------------------- https://github.com/apache/groovy/commit/0c08d52ee2fcd820e197a49d3e531dd8ace1d464 https://github.com/apache/groovy/commit/7260b060f335f6a98598f5458f7934d44ea579bc https://github.com/apache/groovy/commit/da99cd99e4fd3f4c8084622a07cb93dd4e388653 https://github.com/apache/groovy/commit/febdbdd9c18f89f379e1da9cad6fe5281425d4e3 was (Author: emilles): https://github.com/apache/groovy/commit/0c08d52ee2fcd820e197a49d3e531dd8ace1d464 https://github.com/apache/groovy/commit/7260b060f335f6a98598f5458f7934d44ea579bc https://github.com/apache/groovy/commit/da99cd99e4fd3f4c8084622a07cb93dd4e388653 > STC: entry vs field for map-based types > --------------------------------------- > > Key: GROOVY-11387 > URL: https://issues.apache.org/jira/browse/GROOVY-11387 > 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} > @groovy.transform.TypeChecked > void test() { > def map = new HashMap() > def xxx = map.table > def yyy = map.with{ > def z = table > } > print xxx > print yyy > } > test() > {code} > The script should output "nullnull" -- which it does without STC -- and the > inferred types of "xxx", "yyy" and "z" should be String. However, the script > throws IllegalAccessError for the "z" line and the inferred type of the > variables is "Node<String,String>[]". > GROOVY-11367 -- This message was sent by Atlassian Jira (v8.20.10#820010)