Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

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

Copy link
Copy link
@DetachHead

Description

@DetachHead
Issue body actions

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 ?

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    DuplicateAn existing issue was already createdAn existing issue was already created

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.