GROOVY-6050: Fixed inconvertible types error