Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Duplicate
-
1.5.2
-
None
-
None
-
None
Description
The test 'testClosureCallWithPrivateMethod' fails with Groovy 1.5.1 and 1.5.2 (I don't know about the other versions). It should not fail.
class Parent { void publicMethod1() { privateMethod() } void publicMethod2() { [''].each { privateMethod()} } void publicMethod3() { [''].each { protectedMethod()} } private void privateMethod() {} protected void protectedMethod() {} } class Child extends Parent {} class ClosureMethodCallTest extends GroovyTestCase { void testDirectCall() { // No exceptions means the test passes new Child().publicMethod1() } void testClosureCallWithPrivateMethod() { // No exceptions means the test passes new Child().publicMethod2() } void testClosureCallWithProtectedMethod() { // No exceptions means the test passes new Child().publicMethod3() } }
Attachments
Issue Links
- duplicates
-
GROOVY-3073 Private inheritance bug: Closure accessing private method
- Closed