Skip to content

Proposal:Type Pattern matching #20155

New issue

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

Closed
kgtkr opened this issue Nov 20, 2017 · 3 comments
Closed

Proposal:Type Pattern matching #20155

kgtkr opened this issue Nov 20, 2017 · 3 comments
Labels
Duplicate An existing issue was already created

Comments

@kgtkr
Copy link

kgtkr commented Nov 20, 2017

example:

type NotNull=*|null;
type useNotNull=NotNull(number|null);//number;

type ListItem=List<*>;
type useListItem=ListItem(List<string>);//string;

type Constructor={new():*};
type useConstructor=Constructor({new():Date});//Date;

type FuncReturn=()=>*;
type useFuncReturn=FuncReturn(typeof Date.now);//number;
@kitsonk
Copy link
Contributor

kitsonk commented Nov 20, 2017

Can you explain how this differs to #19800, #16067 and #12424?

@ghost
Copy link

ghost commented Nov 20, 2017

@rbuckton had a proposal for matched types that I can't seem to find.

@ghost ghost added the Duplicate An existing issue was already created label Nov 20, 2017
@kgtkr
Copy link
Author

kgtkr commented Nov 20, 2017

sorry
Maybe duplicate #12424

@kgtkr kgtkr closed this as completed Nov 20, 2017
@microsoft microsoft locked and limited conversation to collaborators Jun 14, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Duplicate An existing issue was already created
Projects
None yet
Development

No branches or pull requests

2 participants