test generic
This commit is contained in:
@@ -298,10 +298,28 @@ class BaseTest extends BuddySuite {
|
||||
a.str = "123";
|
||||
callNum.should.be(1);
|
||||
});
|
||||
|
||||
it("bindx should resolve parametric types", {
|
||||
var b = new GenericBindable<TypeBindable1>();
|
||||
b.a = new TypeBindable1();
|
||||
Bind.bind(b.a.str, function (_, _) {
|
||||
callNum ++;
|
||||
});
|
||||
|
||||
b.a.str = "123";
|
||||
callNum.should.be(1);
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
//@:generic
|
||||
class GenericBindable<A> {
|
||||
public var a:A;
|
||||
|
||||
public function new() {}
|
||||
}
|
||||
|
||||
typedef TypeBindable1 = Bindable1;
|
||||
|
||||
class Bindable1 implements bindx.IBindable {
|
||||
|
||||
Reference in New Issue
Block a user