GROOVY-6095: Workaround for generics type checking bug