Skip to content
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

generics that extend conditional types that use another generic don't work #41743

Closed
DetachHead opened this issue Dec 1, 2020 · 1 comment
Closed
Labels
Duplicate An existing issue was already created

Comments

@DetachHead
Copy link
Contributor

DetachHead commented Dec 1, 2020

TypeScript Version: 4.2.0-dev.20201201

Search Terms:
Conditional types generics
Code

interface Foo<T, U extends T extends number? any: any> {}
function foo<T>(bar: Foo<T, number>) {}

Expected behavior:
No error, U is any
Actual behavior:
Error 2344: Type 'number' does not satisfy the constraint 'T extends number? any: any'
Playground Link:
https://www.typescriptlang.org/play?ts=4.2.0-dev.20201201#code/JYOwLgpgTgZghgYwgAgGIHt0B4AqAaZAVWQgA9IQATAZ2RxPIitpAFcBbAI2gH5k4QATwBc-IQD5kAbwC+AWABQMViARhg6EMhiZc4gBSc4UURmz5kbLtHEBKaTKA
Related Issues:
Maybe #41040 ?

@DetachHead DetachHead changed the title generics that extend conditional types that use another generic don't worm generics that extend conditional types that use another generic don't work Dec 1, 2020
@RyanCavanaugh
Copy link
Member

Looks like a duplicate of #30639

@RyanCavanaugh RyanCavanaugh added the Duplicate An existing issue was already created label Dec 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Duplicate An existing issue was already created
Projects
None yet
Development

No branches or pull requests

2 participants