Last active
December 17, 2015 07:48
-
-
Save SimonRichardson/5574927 to your computer and use it in GitHub Desktop.
Example of throwing enums.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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