[
https://issues.apache.org/jira/browse/GROOVY-11370?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17844979#comment-17844979
]
Eric Milles edited comment on GROOVY-11370 at 5/23/24 9:15 PM:
---------------------------------------------------------------
https://github.com/apache/groovy/commit/9d41af9df4c688ca2c91fa9283ad3462e0abc928
https://github.com/apache/groovy/commit/6e2b9471bc2092c4746677f22bc87eda70cbb253
was (Author: emilles):
https://github.com/apache/groovy/commit/9d41af9df4c688ca2c91fa9283ad3462e0abc928
> STC: extension method cannot provide map property (read mode)
> -------------------------------------------------------------
>
> Key: GROOVY-11370
> URL: https://issues.apache.org/jira/browse/GROOVY-11370
> 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, 4.0.22
>
>
> Consider the following:
> {code:groovy}
> @TypeChecked
> void test() {
> def map = [:]
> print map.metaClass
> }
> test()
> {code}
> The script prints "null" (before Groovy 5) indicating that "getMetaClass()"
> extension method is not used. However, node metadata indicates that the
> extension method is used. For example, adding "Number n = map.metaClass"
> says: "Cannot assign value of type groovy.lang.MetaClass to variable of type
> java.lang.Number"
> GROOVY-5001, GROOVY-5491, GROOVY-5568, GROOVY-9115, GROOVY-9123
--
This message was sent by Atlassian Jira
(v8.20.10#820010)