def allowed() { try { def var = 'howdy' throw Exception } catch (Exception) { println('oops') } def var = 'hello' println(var) } def not_allowed() { def var = 'howdy' try { //uncomment below to see compilation error: The current scope already contains a variable of the name var //def var = "bye" throw Exception } catch (Exception) { println(var) } } allowed() not_allowed()