where MyUnionType maps to something like string | number. I would expect this to generate
foo(param:Array<string | number>);
but instead, I am seeing
foo(param:[])
Aside, from what I can tell, you can't actually make a nice way of saying (string | number)[], so the Array<...> syntax is the only way to generate ts output with an array of a union, at least without another @type decl. For this reason, I suspect we will want to change both java arrays and JsArray types to be handled as the same kind of array in ts.
where MyUnionType maps to something like
string | number
. I would expect this to generatebut instead, I am seeing
Aside, from what I can tell, you can't actually make a nice way of saying
(string | number)[]
, so theArray<...>
syntax is the only way to generate ts output with an array of a union, at least without another@type
decl. For this reason, I suspect we will want to change both java arrays and JsArray types to be handled as the same kind of array in ts.Workaround, declare a JsArray instead:
This correctly generates: