You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Paul King (Jira)" <ji...@apache.org> on 2024/11/12 11:41:00 UTC
[jira] [Closed] (GROOVY-11369) STC: map properties "class" and "empty" indicated as read-only
[ https://issues.apache.org/jira/browse/GROOVY-11369?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Paul King closed GROOVY-11369.
------------------------------
> STC: map properties "class" and "empty" indicated as read-only
> --------------------------------------------------------------
>
> Key: GROOVY-11369
> URL: https://issues.apache.org/jira/browse/GROOVY-11369
> Project: Groovy
> Issue Type: Bug
> Components: Static Type Checker
> Affects Versions: 3.0.21, 4.0.21
> Reporter: Eric Milles
> Assignee: Eric Milles
> Priority: Major
> Fix For: 3.0.22, 5.0.0-alpha-9, 4.0.22
>
>
> Consider the following:
> {code:groovy}
> @TypeChecked test(Map map) {
> print map.empty
> print map.class
> print map.metaClass
> map.empty = null
> map.class = null
> map.metaClass = null
> print map
> }
> test([:])
> {code}
> When executed (without {{{}@TypeChecked{}}}) the script prints "null", "null", "null", "[empty: null, class: null, metaClass: null]". So these are all map entry read and writes. However, STC indicates that "class" and "empty" are read-only properties.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)