[ https://issues.apache.org/jira/browse/GROOVY-9328?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Daniil Ovchinnikov updated GROOVY-9328: --------------------------------------- Description: {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. was: {code:java} class C { private privateMethod() {} def anonymousUsage() { new Runnable() { @groovy.transform.CompileStatic @Override void run() { privateMethod() } } } } {code} Expected: code is compiled without errors. Actual: {{Cannot call private method C#privateMethod from class C$1}} Note that Java compiles the same code just fine. > Cannot call private method 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)