Skip to content

Instantly share code, notes, and snippets.

@SimonRichardson
Last active December 17, 2015 07:48
Show Gist options
  • Select an option

  • Save SimonRichardson/5574927 to your computer and use it in GitHub Desktop.

Select an option

Save SimonRichardson/5574927 to your computer and use it in GitHub Desktop.
Example of throwing enums.
class Test {
static function main(){
try {
//throw a(1);
throw b('1');
} catch (e : A) {
trace(e);
} catch (e : B) {
trace(e);
}
}
}
enum A {
a(value : Int);
}
enum B {
b(value : String);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment