Skip to content

Type '"ABC123"' is not assignable to type '${string}${number}'. #49411

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

Closed
bluelovers opened this issue Jun 7, 2022 · 2 comments
Closed

Type '"ABC123"' is not assignable to type '${string}${number}'. #49411

bluelovers opened this issue Jun 7, 2022 · 2 comments
Labels
Duplicate An existing issue was already created

Comments

@bluelovers
Copy link
Contributor

Bug Report

🔎 Search Terms

🕗 Version & Regression Information

  • This is a crash
  • This changed between versions ______ and _______
  • This is the behavior in every version I tried, and I reviewed the FAQ for entries about _________
  • I was unable to test this on prior versions because _______

⏯ Playground Link

https://www.typescriptlang.org/play?#code/G4QwTgBAHgXBAGASA3gZwC5gJYDsDmAvijgK4C2ARgKZgHwQC8EARAIIBCAwgIwBMAzMwDcAKCA

💻 Code

var x: `${string}${number}` = "ABC123";

🙁 Actual behavior

Type '"ABC123"' is not assignable to type '`${string}${number}`'.

🙂 Expected behavior

var x: `${string}${string}${string}${number}` = "ABC123";

=>

var x: `${string}${number}` = "ABC123";
@jcalz
Copy link
Contributor

jcalz commented Jun 7, 2022

This is working as intended. Duplicate-ish of #47048

@RyanCavanaugh RyanCavanaugh added the Duplicate An existing issue was already created label Jun 9, 2022
@typescript-bot
Copy link
Collaborator

This issue has been marked as a 'Duplicate' and has seen no recent activity. It has been automatically closed for house-keeping purposes.

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

4 participants