We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#45974
strictClassInitialization
Parameters
ReturnType
#46855
MethodKeys extends Methods<T> -> T with only its methods
MethodKeys extends Methods<T>
T
T[Method]
We "narrow" Methods based on some criteria, but then try to index back into T with it, and don't have any way to surface that criteria.
Methods
Can use... a type helper called Cast 😬
Cast
type Cast<T, U> = T extends U ? T : T & U;
How often does this come up?
Would be nice if we had a first-class primitive to handle this.
Aside: all of this is very hard to reason about!
The Maybe behavior seems like the wrong thing.
Maybe
satisfies
#7481
Need to write down the 2-3 use-cases.
Details like freshness, excess property checking, etc.
Until then, hold off on the PR, but we want to use it to play with different behavior.
Had a lot of syntax discussions, but the semantics are going to drive the syntax.
Maybe use a different keyword to ensure we're not tying any preconceived ideas?
What if you could write const anywhere in an as and it inferred the const-y version of the expression type? Then you could write
const
as
type Validate<C, T extends C> = T; { x: 0 } as Validate<Point2D, const>;
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Strict Class Initialization with Computed Properties
#45974
strictClassInitialization
, we check for "regular" properties, but not properties declared as comuted properties.Issues with
Parameters
andReturnType
#46855
MethodKeys extends Methods<T>
->T
with only its methodsT[Method]
took us too long to expand, and said "maybe!" and let it pass through.We "narrow"
Methods
based on some criteria, but then try to index back intoT
with it, and don't have any way to surface that criteria.Can use... a type helper called
Cast
😬How often does this come up?
Would be nice if we had a first-class primitive to handle this.
Aside: all of this is very hard to reason about!
The
Maybe
behavior seems like the wrong thing.satisfies
Operator (Contextually Typed-by and Assignable-to Operator)#7481
Need to write down the 2-3 use-cases.
Details like freshness, excess property checking, etc.
Until then, hold off on the PR, but we want to use it to play with different behavior.
Had a lot of syntax discussions, but the semantics are going to drive the syntax.
Maybe use a different keyword to ensure we're not tying any preconceived ideas?
What if you could write
const
anywhere in anas
and it inferred the const-y version of the expression type? Then you could writeThe text was updated successfully, but these errors were encountered: