Open YellowAfterlife opened 10 months ago
EitherType
is meant to be used to describe types when writing externs (hence the package name), but won't provide good typing for actual code.
It is useful for interfacing with external code on dynamic platforms such as JavaScript or Python. Otherwise, use of this type is discouraged.
That is true - I was a little too quick trying to retrofit existing code (which, for the most part, passes values to external JS) to also accept strings/arrays of strings (instead of Haxe enums) coming from external JS, and did not think about the implications until I got the code to run.
Sample:
So, two things:
-dce full
, this results in compiler picking StringMap but culling its get() method, causing a runtime error.