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

Generic return type #43568

Closed
MarvelSQ opened this issue Apr 7, 2021 · 2 comments
Closed

Generic return type #43568

MarvelSQ opened this issue Apr 7, 2021 · 2 comments
Labels
Duplicate An existing issue was already created

Comments

@MarvelSQ
Copy link

MarvelSQ commented Apr 7, 2021

Bug Report

πŸ”Ž Search Terms

Generic with condition

πŸ•— Version & Regression Information

version 4.2.3

⏯ Playground Link

Playground link with relevant code

πŸ’» Code

type Maybe<T, F = null> = T extends never ? F : T;

// 'null'
type A = never extends never ? null : never;

// 'never'
type B = Maybe<never, null>;

πŸ™ Actual behavior

type A is null
type B is never

πŸ™‚ Expected behavior

type A & type B both are null

@whzx5byb
Copy link

whzx5byb commented Apr 7, 2021

Duplicate of #31751

@andrewbranch andrewbranch added the Duplicate An existing issue was already created label Apr 7, 2021
@MarvelSQ
Copy link
Author

MarvelSQ commented Apr 9, 2021

Duplicate of #31751

thanks

@MarvelSQ MarvelSQ closed this as completed Apr 9, 2021
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

3 participants