Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.3.3, 2.4.0-beta-1, 2.4.0-rc-1
-
None
Description
Consider the following:
@TypeChecked class A { @Bindable String foo static void main(String[] args) { A a = new A() a.foo = 'old' a.addPropertyChangeListener('foo') { event -> println 'foo changed: ' + event.oldValue + ' -> ' + event.newValue } a.foo = 'new' } }
The Groovy compiler fails:
[Static type checking] - No such property: oldValue for class: java.lang.Object
This is unexpected, because if I leave the event naming of the closure input parameter and use it.oldValue/it.newValue the static type checking succeeds (as it should).
Attachments
Issue Links
- duplicates
-
GROOVY-8241 SAM parameter type inference for explicit parameter
- Closed
-
GROOVY-8317 Smart type inference doesn't work on explicit closure params
- Closed