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

Type is not narrowed when inferring number-like string #48635

Closed
graphemecluster opened this issue Apr 10, 2022 · 2 comments
Closed

Type is not narrowed when inferring number-like string #48635

graphemecluster opened this issue Apr 10, 2022 · 2 comments
Labels
Duplicate An existing issue was already created

Comments

@graphemecluster
Copy link
Contributor

Bug Report

Is this working as intended?

πŸ”Ž Search Terms

infer with extends

πŸ•— Version & Regression Information

New feature in 4.7.0

⏯ Playground Link

Playground link with relevant code

πŸ’» Code

type foo = "42" extends `${infer T extends number}` ? T : never

πŸ™ Actual behavior

Type of foo is inferred as number.

πŸ™‚ Expected behavior

Type of foo is inferred as 42.

@jcalz
Copy link
Contributor

jcalz commented Apr 10, 2022

It is working as intended until and unless #48094 is merged.

@graphemecluster
Copy link
Contributor Author

Ah, OK. So this is a duplicate of #47141. Sorry for that.

@RyanCavanaugh RyanCavanaugh added the Duplicate An existing issue was already created label Apr 11, 2022
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