https://github.com/Microsoft/TypeScript/issues/16152
https://github.com/Microsoft/TypeScript/issues/17567
getFlowTypeOfReference.promised typehttps://github.com/Microsoft/TypeScript/pull/17077

Promise/PromiseLike inference.Today, if you have
P.then(() => {
if (doSomething()) {
return 1
}
return Promise.resolve("abc");
})
Currently we end up with Promise<number | Promise<string>>.
ts
async function f<T>(x) {
y = await x;
}
PromisedType<T>, which can be described by a new type operator called promised T.await.S -> promised T iff S -> T.S = string and T = Promise<string>.thens aren't the right thens.await anyway.PromiseLike is ever assignable to the promise T.await T?await and .then in the first place.Array.prototype.concat exhibits same behaviorawait, awaited?fulfilled?https://github.com/Microsoft/TypeScript/issues/14366
! in typeof do what you want?null | undefined from T[K]?any under the hood?keyof.Well, so is await and .then in the first place.
Sure, but the problem is that you'll either:
Foo type of a Bar<Foo> type?), orWe can't change how await or Promises work, because TypeScript has to describe JS. We can however change the kinds of concepts TypeScript uses to describe JS.
Most helpful comment
Sure, but the problem is that you'll either:
Footype of aBar<Foo>type?), orWe can't change how
awaitor Promises work, because TypeScript has to describe JS. We can however change the kinds of concepts TypeScript uses to describe JS.