[ https://issues.apache.org/jira/browse/GROOVY-11358?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Eric Milles updated GROOVY-11358: --------------------------------- Description: Consider the following: {code:groovy} abstract class A { private priv @PackageScope pack } @TypeChecked void test (A a) { a.@priv // MissingFieldException a.@pack // MissingFieldException a.priv // MissingPropertyException a.pack // MissingPropertyException } {code} Access to "priv" and "pack" outside of {{A}} will always fail, since it is abstract and so a subclass instance is required. was: Consider the following: {code:groovy} abstract class A { private priv @PackageScope pack } @TypeChecked void test (A a) { a.@priv // MissingFieldException a.@pack // MissingFieldException a.priv // MissingPropertyException a.pack // MissingPropertyException } {code} Access to "priv" and "pack" outside of {{A}} will always fail, since it is abstract and so a subclass instance is required. > STC: error for abstract class private or package-private field access > --------------------------------------------------------------------- > > Key: GROOVY-11358 > URL: https://issues.apache.org/jira/browse/GROOVY-11358 > Project: Groovy > Issue Type: Bug > Components: Static Type Checker > Reporter: Eric Milles > Assignee: Eric Milles > Priority: Major > > Consider the following: > {code:groovy} > abstract class A { > private priv > @PackageScope pack > } > @TypeChecked > void test (A a) { > a.@priv // MissingFieldException > a.@pack // MissingFieldException > a.priv // MissingPropertyException > a.pack // MissingPropertyException > } > {code} > Access to "priv" and "pack" outside of {{A}} will always fail, since it is > abstract and so a subclass instance is required. -- This message was sent by Atlassian Jira (v8.20.10#820010)