GROOVY-7133: Fix class literal expecting primitive types not to use redirect