Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Compiler crash when index type not found #12572

Copy link
Copy link
@ovangle

Description

@ovangle
Issue body actions

TypeScript Version: 2.1.1

Code

Compile the following file, with the compiler flag -d

export interface Test {
   [index: TypeNotFound]: any;
}

Expected behavior:

The following errors get printed to console, (errors copied from compiling without -d flag).

test.ts(3,6): error TS1023: An index signature parameter type must be 'string' or 'number'.
test.ts(3,13): error TS2304: Cannot find name 'TypeNotFound'.

Actual behavior:
The compiler crashes with the following stack trace

Error: Debug Failure. False expression: This is unknown parent for parameter: 154
    at Object.assert (/usr/local/lib/node_modules/typescript/lib/tsc.js:1697:23)
    at Object.fail (/usr/local/lib/node_modules/typescript/lib/tsc.js:1702:19)
    at getParameterDeclarationTypeVisibilityDiagnosticMessage (/usr/local/lib/node_modules/typescript/lib/tsc.js:44696:34)
    at Object.getParameterDeclarationTypeVisibilityError [as getSymbolAccessibilityDiagnostic] (/usr/local/lib/node_modules/typescript/lib/tsc.js:44643:41)
    at handleSymbolAccessibilityError (/usr/local/lib/node_modules/typescript/lib/tsc.js:43565:40)
    at emitEntityName (/usr/local/lib/node_modules/typescript/lib/tsc.js:43699:17)
    at emitTypeReference (/usr/local/lib/node_modules/typescript/lib/tsc.js:43715:17)
    at emitType (/usr/local/lib/node_modules/typescript/lib/tsc.js:43660:28)
    at writeTypeOfDeclaration (/usr/local/lib/node_modules/typescript/lib/tsc.js:43590:17)
    at emitParameterDeclaration (/usr/local/lib/node_modules/typescript/lib/tsc.js:44640:17)
Reactions are currently unavailable

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptA bug in TypeScript

Type

No type
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.