GROOVY-6650: Fix regression in method selection