Skip to content

Instantly share code, notes, and snippets.

@rodrigoSaladoAnaya
Last active May 20, 2016 19:21
Show Gist options
  • Save rodrigoSaladoAnaya/11023110696a67173ee2b0c625666dd8 to your computer and use it in GitHub Desktop.
Save rodrigoSaladoAnaya/11023110696a67173ee2b0c625666dd8 to your computer and use it in GitHub Desktop.
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