Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
1.5.7, 1.6-beta-2
-
None
Description
This script runs fine:
class MyClosure extends Closure { MyClosure(owner) { super(owner) } void run() { println 'running' } } new MyClosure(this).run()
But when I run this script:
class MyClosure extends Closure { MyClosure() { super(this) } void run() { println 'running' } } new MyClosure().run()
I receive:
java.lang.VerifyError: (class: MyClosure, method: <init> signature: ()V) Expecting to find object/array on stack
Perhaps accessing the this variable inside the class definintion isn't supported by current scoping rules but in any case we should get a nice error not VerifyError.