Skip to content

Instantly share code, notes, and snippets.

@skial
Created October 7, 2012 10:45
Show Gist options
  • Select an option

  • Save skial/3847840 to your computer and use it in GitHub Desktop.

Select an option

Save skial/3847840 to your computer and use it in GitHub Desktop.
@:overload and @:macro via andy li google groups haxe mailing list
// https://groups.google.com/d/msg/haxelang/IAqSXSREyHA/hjq-ZcLAcr4J
@:overload(function(a:Dynamic,b:Dynamic):Void{})
@:overload(function<A,B,C>(a:A, b:B, c:C):C{})
@:macro public static function foo(args:Array<Expr>):Expr {
return switch (args.length) {
case 2: args[0];
case 3: args[2];
default: throw "wrong args";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment