GROOVY-6479: Infer closure parameter types when used in an implicit coercion context