Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.2.0-beta-1
-
None
Description
import groovy.transform.TypeChecked @TypeChecked class MyCar { String brand } @TypeChecked(extensions = ["MyChecker.grovy"]) class MyCarMain { static void main(String[] args) { def main = new MyCarMain() main.configureCar { brand = "BMW" } } MyCar configureCar(@DelegatesTo(MyCar) Closure closure) { def car = new MyCar() closure.delegate = car closure.resolveStrategy = Closure.DELEGATE_FIRST closure.call() car } }
Same when MyCar declares explicit getter and setter instead of property. Changing to setBrand("BMW") solves the problem.