Microsoft/TypeScript

Definite assignment assertion in JS not flagged

Open

#48.446 geöffnet am 27. März 2022

Auf GitHub ansehen
 (2 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)TypeScript (6.726 Forks)batch import
BugDomain: JavaScriptHelp Wanted

Repository-Metriken

Stars
 (48.455 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 6T 17h) (9 gemergte PRs in 30 T)

Beschreibung

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

Contributor Guide