You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Eric Milles (Jira)" <ji...@apache.org> on 2024/05/08 19:16:00 UTC
[jira] [Created] (GROOVY-11370) STC: extension method cannot provide map property (read mode)
Eric Milles created GROOVY-11370:
------------------------------------
Summary: 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
Reporter: Eric Milles
Assignee: Eric Milles
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
--
This message was sent by Atlassian Jira
(v8.20.10#820010)