GROOVY-6729: Fix closure parameter type inference in case of a static method call