Skip to content

Instantly share code, notes, and snippets.

@alecmce
Created October 30, 2011 21:40
Show Gist options
  • Save alecmce/1326479 to your computer and use it in GitHub Desktop.
Save alecmce/1326479 to your computer and use it in GitHub Desktop.
Haxe Enum Example
enum MyEnum
{
first;
second;
third(param:MyParam);
}
class MyClass
{
private var _state:MyEnum;
public function triggerThird(param:MyParam):Void
{
_state = third(param);
}
public function test():Void
{
switch (_state)
{
case first:
trace("first");
case second:
trace("second");
case third(param):
trace("third: " + param);
}
}
}
@bigarobas
Copy link

I get the same error than you using enums with parameters.
Did you find any answer 2 years later ? :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment