GROOVY-6311: extend spreading ability to check for iterator() method and use the provided type from there