Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
3.0.21, 5.0.0-alpha-8, 4.0.21
-
None
Description
Consider the following:
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()
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.