Skip to content

Compiler crashed by the variable globalThis which implicitly typed as typeof globalThis, when generating declarations #37981

Closed
@JasonHK

Description

@JasonHK

TypeScript Version: 3.9.0-dev.20200415

Search Terms: declaration, globalThis, implicit, variable

Code

import { variable } from "./variable";
export const globalThis = variable;

// variable.ts
export const variable = globalThis;

Expected behavior:

The snippet above should work just fine, no matter --declaration enabled or not.

Actual behavior:

When --declaration was disabled, the snippet above work just fine.

But when --declaration was enabled, the compiler just crashed with a single error message:

Debug Failure. False expression.

Playground Link: N/A

Related Issues: N/A

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