GROOVY-5943: Fix NPE when a method uses a wildcard generic