From 1d87fa9db8b0ed0dcea4498ba430ba0cdb0edb23 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sat, 22 Jun 2019 14:24:08 +0100 Subject: Hack around wait and metaClass --- scripts/toy.groovy | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'scripts/toy.groovy') diff --git a/scripts/toy.groovy b/scripts/toy.groovy index bd18e40..d35ced3 100644 --- a/scripts/toy.groovy +++ b/scripts/toy.groovy @@ -1603,6 +1603,10 @@ return new Object() { final removeRequestable = { String name -> requestables.remove(name); }; + // This exists because calling .wait(t) in a metaClass method + // calls it on the metaClass, not on the original object + void pause(int t) { wait(t); } + String main() { -- cgit v1.2.3