Microsoft/TypeScript

Definite assignment assertion in JS not flagged

Aberta

#48.446 aberto em 27 de mar. de 2022

 (2 comentários) (0 reação) (0 responsável)TypeScript (13.395 forks)batch import
BugDomain: JavaScriptHelp Wanted

Métricas do repositório

Stars
 (108.860 estrelas)
Métricas de merge de PR
 (Métricas PR pendentes)

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

Guia do colaborador