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

Cyclic extends generics #179

Open
kaleidawave opened this issue Jul 25, 2024 · 0 comments
Open

Cyclic extends generics #179

kaleidawave opened this issue Jul 25, 2024 · 0 comments
Assignees
Labels
blocking These issues are blocking the checker being used in projects checking Issues around checking tsc-behaviour Trying to match TSC behaviour

Comments

@kaleidawave
Copy link
Owner

A generic can reference itself in the extends clause.

type X<T> = T extends (infer U extends { a: U })

This seems to be true for all generics: infer T, mapped keys, on functions and structures

The following needs implementing:

  • in subtyping: specialisation needs to happen first then extends subtype checking
  • during synthesis:
@kaleidawave kaleidawave added checking Issues around checking blocking These issues are blocking the checker being used in projects tsc-behaviour Trying to match TSC behaviour labels Jul 25, 2024
@kaleidawave kaleidawave self-assigned this Jul 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocking These issues are blocking the checker being used in projects checking Issues around checking tsc-behaviour Trying to match TSC behaviour
Projects
None yet
Development

No branches or pull requests

1 participant