You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Daniil Ovchinnikov (Jira)" <ji...@apache.org> on 2019/12/04 13:19:00 UTC
[jira] [Updated] (GROOVY-9328) Cannot call private member of
containing class in @CS
[ https://issues.apache.org/jira/browse/GROOVY-9328?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Daniil Ovchinnikov updated GROOVY-9328:
---------------------------------------
Summary: Cannot call private member of containing class in @CS (was: Cannot call private method of containing class in @CS)
> Cannot call private member of containing class in @CS
> -----------------------------------------------------
>
> Key: GROOVY-9328
> URL: https://issues.apache.org/jira/browse/GROOVY-9328
> Project: Groovy
> Issue Type: Bug
> Components: Static Type Checker
> Affects Versions: 2.5.8
> Reporter: Daniil Ovchinnikov
> Priority: Major
>
> {code:java}
> class C {
> private C() {}
> private privateMethod() {}
> def anonymousUsage() {
> new Runnable() {
> @groovy.transform.CompileStatic
> @Override
> void run() {
> privateMethod()
> new C()
> }
> }
> }
> }{code}
> Expected: code is compiled without errors.
> Actual: 2 errors:
> {{Cannot call private method C#privateMethod from class C$1}}
> {{Cannot call private constructor for C from class C$1}}
> Note that Java compiles the same code just fine.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)