Microsoft/TypeScript

Definite assignment assertion in JS not flagged

开放

#48,446 创建于 2022年3月27日

 (2 条评论) (0 个反应) (0 位负责人)TypeScript (13,395 个派生)batch import
BugDomain: JavaScriptHelp Wanted

仓库指标

星标
 (108,860 个星标)
PR 合并指标
 (PR 指标待抓取)

描述

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

贡献者指南