I'm having trouble chaining functions/promises using the Bluebird extern. I believe Haxe's type inference engine is failing to deduce the return type of a fulfilledHandler that comes after a fulfilledHandler with a return type of Void.
Here's a small test case that exhibits the problem:
import buddy.BuddySuite;
import js.npm.Bluebird;
using buddy.Should;
class TestBluebird extends BuddySuite {
public function new() {
describe("Testing Bluebird", function () {
it("Allows chaining after a '* -> Void' function", function (done) {
var p = new Bluebird(function (resolve, reject) {
resolve("first value");
}).then(function (firstValue) {
firstValue.should.be("first value");
}).then(function () {
done();
});
});
});
}
}
I think I can work around the issue by returning "null" in one function and accepting a dummy arg in the next, but this is awkward for chaining existing functions together, and problematic for making use of externs or libs.
I'm having trouble chaining functions/promises using the Bluebird extern. I believe Haxe's type inference engine is failing to deduce the return type of a fulfilledHandler that comes after a fulfilledHandler with a return type of Void.
Here's a small test case that exhibits the problem:
I think I can work around the issue by returning "null" in one function and accepting a dummy arg in the next, but this is awkward for chaining existing functions together, and problematic for making use of externs or libs.