Skip to content

Uninitialized identifer causes compiler crash #35683

Closed
@ahejlsberg

Description

@ahejlsberg

TypeScript Version: 3.8.0-dev

Code

// Compile with --strict
let a: {};
a;

Expected behavior:

No crash.

Actual behavior:

Crash!

Related Issues:

Crash is caused by code added in #33171. Beyond this crash, I see several issues with that code. For example, it assumes that if the return type is a union type, then the type annotation AST node is a UnionTypeNode, which by no means is a given. For example, the return type node could be a reference to a type alias.

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptCrashFor flagging bugs which are compiler or service crashes or unclean exits, rather than bad outputHigh Priority

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions