Microsoft/TypeScript
Vedi su GitHubDefinite assignment assertion in JS not flagged
Open
#48.446 aperta il 27 mar 2022
BugDomain: JavaScriptHelp Wanted
Metriche repository
- Star
- (48.455 star)
- Metriche merge PR
- (Merge medio 6g 17h) (9 PR mergiate in 30 g)
Descrizione
Bug Report
Noted by someone on Discord.
🔎 Search Terms
non null assertion javascript error
Related https://github.com/microsoft/TypeScript/issues/17222
🕗 Version & Regression Information
- This is the behavior in every version I tried
⏯ Playground Link
Playground link with relevant code
💻 Code
const a = { a!: 1 };
🙁 Actual behavior
There's no error; crashes at runtime
🙂 Expected behavior
There should be an error