[
https://issues.apache.org/jira/browse/GROOVY-11393?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Eric Milles resolved GROOVY-11393.
----------------------------------
Fix Version/s: 5.0.0-alpha-9
Resolution: Fixed
https://github.com/apache/groovy/commit/91edb3284d6c44245e39c9c7c5800e02d974e8ec
> STC: error for non-static member of class delegate
> --------------------------------------------------
>
> Key: GROOVY-11393
> URL: https://issues.apache.org/jira/browse/GROOVY-11393
> 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: 5.0.0-alpha-9
>
>
> Consider the following:
> {code:groovy}
> class Foo {
> static getBar() { 'bar' }
> Object getBaz() { 'baz' }
> }
> @groovy.transform.TypeChecked
> void test() {
> def foo = Foo
> foo.with {
> println bar
> println baz
> println getBar()
> println getBaz()
> }
> }
> test()
> {code}
> This script prints "bar" and then throws a {{MissingPropertyException}} or
> {{ClassCastException}} (static compilation). The type checker does not warn
> of non-static member access for a {{Class}} delegate.
> GROOVY-9415, GROOVY-9618, GROOVY-10820
--
This message was sent by Atlassian Jira
(v8.20.10#820010)