generics in BindExt

This commit is contained in:
Dima Granetchi
2014-11-30 21:36:52 +02:00
parent 8070224d9d
commit 7b60b7bc34
+4 -4
View File
@@ -32,20 +32,20 @@ typedef Chain = {
@:access(bindx.BindMacros)
class BindExt {
@:noUsing macro static public function expr(expr:Expr, listener:Expr):Expr {
@:noUsing macro static public function expr<T>(expr:ExprOf<T>, listener:ExprOf<Null<T>->Null<T>->Void>):ExprOf<Void->Void> {
return internalBindExpr(expr, listener);
}
@:noUsing macro static public function exprTo(expr:Expr, target:Expr):Expr {
@:noUsing macro static public function exprTo<T>(expr:ExprOf<T>, target:ExprOf<T>):ExprOf<Void->Void> {
var type = Context.typeof(expr).toComplexType();
return internalBindExpr(expr, macro function (_, to:Null<$type>) $target = to);
}
@:noUsing macro static public function chain(expr:Expr, listener:Expr):Expr {
@:noUsing macro static public function chain<T>(expr:ExprOf<T>, listener:ExprOf<Null<T>->Null<T>->Void>):ExprOf<Void->Void> {
return internalBindChain(expr, listener);
}
@:noUsing macro static public function chainTo(expr:Expr, target:Expr):Expr {
@:noUsing macro static public function chainTo<T>(expr:ExprOf<T>, target:ExprOf<T>):ExprOf<Void->Void> {
var type = Context.typeof(expr).toComplexType();
return internalBindChain(expr, macro function (_, to:Null<$type>) $target = to);
}