GROOVY-7215: Fix stub generation with traits