Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
Description
Follow up to GROOVY-8999, GROOVY-9093 and GROOVY-9136. Consider the following:
class Foo { private String field = 'value' } class Bar { @groovy.transform.CompileStatic void test(Foo foo) { foo.with { field // Access to Foo#field is forbidden } } }
class Foo { private String field = 'value' } class Bar { @groovy.transform.CompileStatic void test(Foo foo) { println foo.field } } new Bar().test(new Foo()) // prints "value"
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.
Attachments
Issue Links
- links to