Skip to content

Commit

Permalink
Don't use Future/Promise<Dynamic>
Browse files Browse the repository at this point in the history
  • Loading branch information
back2dos committed Jun 16, 2020
1 parent 4d2a75c commit c9d0774
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/tink/core/Future.hx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ abstract Future<T>(FutureObject<T>) from FutureObject<T> to FutureObject<T> {

static public final NOISE:Future<Noise> = Future.sync(Noise);
@:deprecated('use Future.NOISE instead') static public final NULL:Future<Noise> = NOISE;
static public final NEVER:Future<Dynamic> = (NeverFuture.inst:FutureObject<Dynamic>);
static public final NEVER:Future<Noise> = (NeverFuture.inst:FutureObject<Noise>);

public var status(get, never):FutureStatus<T>;
inline function get_status()
Expand Down Expand Up @@ -327,7 +327,7 @@ private interface FutureObject<T> {
}

private class NeverFuture<T> implements FutureObject<T> {
public static var inst(default, null):NeverFuture<Dynamic> = new NeverFuture();
public static var inst(default, null):NeverFuture<Noise> = new NeverFuture();
function new() {}
public function getStatus():FutureStatus<T>
return NeverEver;
Expand Down
2 changes: 1 addition & 1 deletion src/tink/core/Promise.hx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ abstract Promise<T>(Surprise<T, Error>) from Surprise<T, Error> to Surprise<T, E

static public final NOISE:Promise<Noise> = Future.sync(Success(Noise));
@:deprecated('use Promise.NOISE instead') static public final NULL:Promise<Noise> = NOISE;
static public final NEVER:Promise<Dynamic> = Future.NEVER;
static public final NEVER:Promise<Noise> = Future.NEVER;

public inline function new(f:(T->Void)->(Error->Void)->CallbackLink)
this = new Future(cb -> f(v -> cb(Success(v)), e -> cb(Failure(e))));
Expand Down

0 comments on commit c9d0774

Please sign in to comment.