Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Duplicate
-
Affects Version/s: 1.7.1
-
Fix Version/s: None
-
Component/s: Compiler
-
Labels:None
-
Number of attachments :
Description
class Foo {
private boolean b = false
def foo(msg) {
["a"].each {
println it + b
}
}
}
class Bar extends Foo {
def foo(Object msg) {
super.foo(msg)
}
}
new Foo().foo("a")
new Bar().foo("a")
Output:
afalse
Caught: groovy.lang.MissingPropertyException: No such property: b for class: Bar
at Foo$_foo_closure1.doCall(test.groovy:6)
at Foo.foo(test.groovy:5)
at Bar.super$2$foo(test.groovy)
at Bar.foo(test.groovy:14)
at test.run(test.groovy:20)
Issue Links
- duplicates
-
GROOVY-3142
Unable to access inherited private fields from a closure within an inherited method
-
-
GROOVY-4083
private members should be accessible in closures used from sub classes
-
Activity
Roshan Dawrani
made changes -
| Field | Original Value | New Value |
|---|---|---|
| Status | Open [ 1 ] | Resolved [ 5 ] |
| Resolution | Duplicate [ 3 ] |
Roshan Dawrani
made changes -
| Link | This issue duplicates GROOVY-3142 [ GROOVY-3142 ] |
Roshan Dawrani
made changes -
| Link |
This issue duplicates |
Paul King
made changes -
| Status | Resolved [ 5 ] | Closed [ 6 ] |
Duplicate of the just the previous issue raised -
GROOVY-4083.