Eric Milles created GROOVY-11393:
------------------------------------

             Summary: 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: 4.0.21, 5.0.0-alpha-8, 3.0.21
            Reporter: Eric Milles
            Assignee: Eric Milles


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 fails with {{MissingPropertyException}} or 
{{ClassCastException}} (static compilation).  The type checker does not warn of 
non-static member access for a {{Class}} delegate.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to