GROOVY-6650: Fix method selection in case of last argument being an array