-
Type:
Bug
-
Status: Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 2.5.8, 3.0.0-rc-1
-
Fix Version/s: 3.0.0-rc-2, 2.5.13
-
Component/s: Static compilation
-
Labels:None
Compilation fails when accessing a protected(via `thisObject`, `owner` and `delegate`)/package-private super class field from inside a closure:
new GroovyShell().with { evaluate ''' package a abstract class Abstract { protected String protectedField = 'field' } assert true ''' evaluate ''' package b @groovy.transform.CompileStatic class Concrete extends a.Abstract { String doThing() { 'something'.with { return owner.protectedField // `thisObject.protectedField`, `delegate.protectedField` fails too } } } assert true ''' evaluate 'assert new b.Concrete().doThing() == "field"'
- is cloned by
-
GROOVY-9293 Compilation error when accessing package-private super class field using `this` from inside a closure
-
- Closed
-
- relates to
-
GROOVY-9288 Compilation error when accessing a protected super class field from inside a closure
-
- Closed
-
- links to