You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Solve this problem over and over again (how do I refer to the return type of a function type? how do I refer to the value type of an array type? how do I refer to the Foo type of a Bar<Foo> type?), or
Leave everyone who doesn't have a broadly applicable enough instance of the same problem in the lurch
We 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.
Trailing commas in type argument/parameter lists
#16152
Narrowing from index signature-originating properties
#17567
getFlowTypeOfReference
.The
promised
type#17077
With the strictVarianceChecks and other changes, we created a difficult situation for
Promise
/PromiseLike
inference.Today, if you have
Currently we end up with
Promise<number | Promise<string>>
.There seemed to be some fixes our team was looking at with how we infer between union types.
This is difficult because now you have to get into some strange pattern-matching like behavior for unions.
What about a negation type?
Promised type operator
PromisedType<T>
, which can be described by a new type operator calledpromised T
.await
.S -> promised T
iffS -> T
.S = string
andT = Promise<string>
.then
s aren't the rightthen
s.await
anyway.Name bike-shedding
PromiseLike
is ever assignable to thepromise T
.await T
?Discussion among community
await
and.then
in the first place.Array.prototype.concat
exhibits same behaviorConclusion
await
,awaited
?fulfilled
?Non-null assertion type operator
#14366
!
intypeof
do what you want?null | undefined
fromT[K]
?any
under the hood?keyof
.The text was updated successfully, but these errors were encountered: