Groovy Closure not recognized

any thoughts on why closure (->) not getting recognized?

@ssridharan

myClosure { TYPE arg ->
  // code
}

myOtherClosure { ->
  // code
}

Yes, closure works. I just had to surround in {} wherever closure is used. Thanks