GROOVY-5924: Closure parameter type inference

This pull request is an implementation of closure parameter type inference following the discussion at http://groovy.329449.n5.nabble.com/Closure-parameter-type-inference-td5717804.html