Skip to content

TypeScript crashes when assigning property to function #29672

@billyjanitsch

Description

@billyjanitsch

TypeScript Version:

3.4.0-dev.20190131, but I can repro back to at least 3.2.1.

Search Terms:

crash function property assignment
Debug Failure. Diagnostic emitted without context

Code

function A() {
  return null
}

A.B = 'foo'

function C() {
  return null
}

C.D = A

Expected behavior:

When running tsc -d, TypeScript should parse this file.

Actual behavior:

TypeScript crashes with a cryptic error message:

Debug Failure. Diagnostic emitted without context

Note that this only happens when the -d flag is specified.

Playground Link:

I can't repro in the playground because the playground doesn't seem to have an option to generate declarations.

Related Issues:

No, there are 0 issues containing the error message.

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScript

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions