in previous versions (evidently up to haxe 3-3-0 RC) it was possible to get
the value nested inside an enum constructor with a switch.
It then looked like this:
var uniqueName : String = "";
>
> switch( transFishBowlContainer )
> {
> case TransFishBowlContainer.fishBowl( fishBowl ) :
> uniqueName = fishBowl.uniqueName;
>
> case TransFishBowlContainer.transFishBowlCypher( transFishBowlCypher ) :
> uniqueName = transFishBowlCypher.fishBowlUniqueName;
>
> } // switch( transFishBowlContainer )
>
>
But this does not work in Haxe 3-4-2 anymore.
An error is thrown. Apparently the compiler resolves the enum constructor
as a function.
Also see here:
https://try.haxe.org/#82A7F
*Why is that?* This keeps me from updating at the moment. The change of
code even with simple workarounds would bust my timeline as I have used
this enum-constructor-switch constellation quite often.
Is it intended to be that way? Or is it a bug?
If it is intended, what is the reason for that?
Kind regards
Arnim