-
Notifications
You must be signed in to change notification settings - Fork 38
Open
Description
related: #68
example
You have a fluent interface but one of the method X is slightly restrictive and doesn't return this but a subset of its this. In this case if the next method Y returns this it will share its constraints.
problem: if that method Y may also follow another method Z that returns this, its return type becomes dynamic.
solution: introduce a this return type
NB
It would be impractical to require the user to provide all the possibilities as unions.
It's the job of the static type checker; it should be able to infer the correct type from the current this.
proposal
example(name: Type) => this
Metadata
Metadata
Assignees
Labels
No labels