Last active
May 20, 2016 19:21
-
-
Save rodrigoSaladoAnaya/11023110696a67173ee2b0c625666dd8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class C { | |
def str1 = 'Hola' | |
def x = { nestedClosures -> | |
def str2 = 'mundo' | |
nestedClosures() | |
} | |
} | |
def clozure = { | |
x { | |
println "${str1} ${str2}" | |
} | |
} | |
clozure.delegate = new C() | |
clozure() | |
/** | |
* output: groovy.lang.MissingPropertyException: No such property: str2 for class: delegate | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment