GROOVY-5907 Object.with seems to lose typing when generics are used