Microsoft/TypeScript

Definite assignment assertion in JS not flagged

Open

#48,446 建立於 2022年3月27日

在 GitHub 查看
 (2 留言) (0 反應) (0 負責人)TypeScript (6,726 fork)batch import
BugDomain: JavaScriptHelp Wanted

倉庫指標

Star
 (48,455 star)
PR 合併指標
 (平均合併 6天 17小時) (30 天內合併 9 個 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

貢獻者指南