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

贡献者指南