Skip to content

Instantly share code, notes, and snippets.

@skial
Created December 7, 2014 14:36
Show Gist options
  • Save skial/7a03271b6612274f348e to your computer and use it in GitHub Desktop.
Save skial/7a03271b6612274f348e to your computer and use it in GitHub Desktop.
-main Main
-js test.js
--next
-cmd node test.js
package ;
/**
* ...
* @author Skial Bainn
*/
class Main {
public static function main() new Main();
public function new() {
var a:Thing = Thing.A;
var b:Thing = Thing.B;
var c:Thing = 3;
print(a);
print(b);
print(c);
}
public function print(v:Int):Void {
switch (v) {
case Thing.A: trace('A');
case Thing.B: trace('B');
case _: trace('unknown');
}
}
}
@:enum abstract Thing(Int) from Int to Int {
public var A = 1;
public var B = 2;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment