Spock doesn't rewrite it to `this.getThisObject()`.

This is what Spock does

|with(list) {|

|   SpockRuntime.verifyMethodCondition(this, "contains", [1])|

|}

|

|The transformation from `this` to `this.getThisObject()` is done by groovy at a later stage. My guess somewhere in the AST-to-Bytecode ASM code as I can see the upper version in the
last stage of the AST-Transforms.
|||


|with(list) {|

|   SpockRuntime.verifyMethodCondition(this.getThisObject(), "contains", [1])|

|}|||
Am 20.11.2017 um 22:09 schrieb eric.mil...@thomsonreuters.com:

When you rewrite to this form:

|with(list) {|
|  SpockRuntime.verifyMethodCondition(this.getThisObject(), "contains", [1])|

|}|

You've esentially frozen your choice of delegate, owner or this. The dynamic resolution of "implicit this" to one of those is no longer going to happen.  I guess you'd need to re-implement the resolution strategy.


Reply via email to