[
https://issues.apache.org/jira/browse/GROOVY-11368?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Eric Milles resolved GROOVY-11368.
----------------------------------
Fix Version/s: 3.0.22
Resolution: Fixed
https://github.com/apache/groovy/commit/2a078df5b0e8c6c9bfa3551340b1bf46c20de9d0
> SC: map access different for parameter and local variable of same type
> ----------------------------------------------------------------------
>
> Key: GROOVY-11368
> URL: https://issues.apache.org/jira/browse/GROOVY-11368
> Project: Groovy
> Issue Type: Bug
> Components: Static compilation
> Affects Versions: 3.0.21
> Reporter: Eric Milles
> Assignee: Eric Milles
> Priority: Major
> Fix For: 3.0.22
>
>
> Consider the following:
> {code:groovy}
> class C implements Map<String,String> {
> @Delegate Map<String,String> impl = [:]
> }
> def map = new C()
> assert map.entry == null
> assert map.empty == null
> assert map.class == null
> assert map.metaClass == null
> def test(C map) {
> assert map.entry == null
> assert map.empty == null
> assert map.class == null
> assert map.metaClass == null
> }
> test(new C())
> {code}
> The method-based test fails with "class" returning the map class. Something
> is different for local variable and parameter property expressions.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)