stc icon indicating copy to clipboard operation
stc copied to clipboard

feat: Handle assignment of a template literal to a number

Open awareness481 opened this issue 2 years ago • 3 comments

function f4<T extends number>(s: string, n: number, b: boolean, t: T) {
  let x: `*${number}*`;
  x = `*${b}*` as const; // Error
}

Reports the required error for the above case where *${boolean}* is assigned to *${number}*

awareness481 avatar Jun 12 '23 16:06 awareness481

Thank you for the PR! Commit: ba73ea7450c3515025b31b2588200a2d969bfb38

Files to check

These are files which is affected by the current PR, but not reflected. If there's no file below this message, please ignore this message.

You can run ./scripts/auto-unignore.sh from crates/stc_ts_file_analyzer for typescript files, and ./scripts/check.sh from crates/stc_ts_type_checker for *.stats.rust-debug files.

github-actions[bot] avatar Jun 12 '23 16:06 github-actions[bot]

Can you rebase?

kdy1 avatar Aug 07 '23 11:08 kdy1

This has been at the back of my mind for the past two months but I ve been extremely busy the last two months. I will get to it asap!

awareness481 avatar Oct 13 '23 07:10 awareness481