via JoePeck, Typebuilder should handle an Array of $ref type string with enum. 1. Recognize when an array has a $ref which is a string with enums. In such cases we should probably have an Array<String> instead of Array<Enum> 2. In such cases allow Array::addItem(Type::Enum) instead of Array::addItem(String) which under the hood does pushString(getWebEnumConstantValue(enumValue)). 3. For this to work, we may need something special like "EnumArray", or Array<T1, T2> where T1 is the storage, and T2 is the input.
<rdar://problem/17262363>
Originally noticed when working on bug 130913.
As far as I remember, this is supported by the new code generator (if not from C++, at least in the JSON file). These issues are much harder to fix in the current generator because the ordering of enums, typedefs, etc is very fragile.