Skip to content

Conversation

@resolritter
Copy link
Contributor

note: This is on top of #123, so that it can be built properly


Test cases have been adapted from Type inference in conditional types, except for the following scenario

type ReturnType<T extends (...args: any[]) => infer R> = R; // Error, not supported

Since it's not supported by TypeScript, it's not handled here, either.

closes #101

@mjambon
Copy link
Contributor

mjambon commented Jan 29, 2021

Looks great to me. Can we have your stamp of approval, @maxbrunsfeld? (It's a simple extension)

@mjambon
Copy link
Contributor

mjambon commented Jan 29, 2021

@resolritter you'll have to generate the files for both typescript and tsx (I use e.g. (cd tsx && npx tree-sitter generate)).

@resolritter resolritter force-pushed the infer_conditional_types branch from c0ded18 to 0b693ad Compare January 29, 2021 05:12
@resolritter
Copy link
Contributor Author

resolritter commented Feb 3, 2021

@resolritter you'll have to generate the files for both typescript and tsx (I use e.g. (cd tsx && npx tree-sitter generate)).

npm run build seems to work for generating both TSX and TypeScript

@mjambon
Copy link
Contributor

mjambon commented Feb 3, 2021

@resolritter good to know. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support type inference in conditional types ('infer')

3 participants