GROOVY-5924: make FromString support polymorphic signatures