Microsoft/TypeScript

Definite assignment assertion in JS not flagged

Open

#48 446 ouverte le 27 mars 2022

Voir sur GitHub
 (2 commentaires) (0 réactions) (0 assignés)TypeScript (6 726 forks)batch import
BugDomain: JavaScriptHelp Wanted

Métriques du dépôt

Stars
 (48 455 stars)
Métriques de merge PR
 (Merge moyen 6j 17h) (9 PRs mergées en 30 j)

Description

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

Guide contributeur