GROOVY-6522: Perform generic type inference with implicit closure coercion