You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What's the point of Std.string(e) here instead of just tracing e?
I guess the only case for that is when the type of e is not known to be the enum at compile time.
Std.string(e) is nothing more than a run-time call so of course static extensions don't apply.
This would be a new feature where the printing implementation somehow routes to a custom function for enums. On some targets we might be able to cheat by actually injecting toString methods into the generated code, but eeeh...
Either way, this would require a haxe-evolution that considers all targets, and probably also the "" + enum situation. I agree that this would be nice to have, but it's going to require quite a bit of effort.
Currently there seems no way to override the default
toString
behaviour of enum that would work withStd.string()
ref: HaxeFoundation/haxe-evolution#10
The text was updated successfully, but these errors were encountered: