Eric Milles created GROOVY-9195: ----------------------------------- Summary: STC: mixed checking for access to non-public fields Key: GROOVY-9195 URL: https://issues.apache.org/jira/browse/GROOVY-9195 Project: Groovy Issue Type: Bug Reporter: Eric Milles
Follow up to GROOVY-9136. Consider the following: {code:groovy} class Foo { private String field = 'value' } class Bar { void test(Foo foo) { foo.with { field // Access to Foo#field is forbidden } } } {code} {code:groovy} class Foo { private String field = 'value' } class Bar { void test(Foo foo) { println foo.field } } new Bar().test(new Foo()) // prints "value" {code} Since STC produces an error for access to Foo.field as variable expression, I would expect the same error for access to the field through property expression. Same goes for protected and package-private with the appropriate package separation of Foo and Bar. -- This message was sent by Atlassian JIRA (v7.6.14#76016)