-
Notifications
You must be signed in to change notification settings - Fork 13.3k
tsc crashes with TypeError: Cannot read property 'text' of undefined #32358
Copy link
Copy link
Closed
Copy link
Labels
BugA bug in TypeScriptA bug in TypeScriptCrashFor flagging bugs which are compiler or service crashes or unclean exits, rather than bad outputFor flagging bugs which are compiler or service crashes or unclean exits, rather than bad output
Milestone
Description
TypeScript Version: 3.6.0-dev.20190711 (also checked on stable 3.5.2)
Search Terms:
- TypeError: Cannot read property 'text' of undefined at emitPropertyAccessExpression
Code
test.ts:
const fn = (param: string) => undefined;
const foo = {bar: 'a'};
fn(({[foo.bar]: c}) => undefined);$ tsc test.ts
Expected behavior:
tsc exits with error TS2345: Argument of type '({[foo.bar]: c}: any) => void' is not assignable to parameter of type 'string'. on line 4.
Actual behavior:
tsc crashes with error:
node_modules/typescript/lib/tsc.js:74862
throw e;
^
TypeError: Cannot read property 'text' of undefined
at emitPropertyAccessExpression (node_modules/typescript/lib/tsc.js:71027:77)
at pipelineEmitWithHint (node_modules/typescript/lib/tsc.js:70478:32)
at emitExpression (node_modules/typescript/lib/tsc.js:70140:13)
at emitComputedPropertyName (node_modules/typescript/lib/tsc.js:70684:13)
at pipelineEmitWithHint (node_modules/typescript/lib/tsc.js:70207:32)
at emit (node_modules/typescript/lib/tsc.js:70127:13)
at emitBindingElement (node_modules/typescript/lib/tsc.js:70999:17)
at pipelineEmitWithHint (node_modules/typescript/lib/tsc.js:70297:32)
at emit (node_modules/typescript/lib/tsc.js:70127:13)
at emitNodeList (node_modules/typescript/lib/tsc.js:72467:21)
Playground Link:
Related Issues:
Not found.
Original issue: palantir/tslint#4791
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptCrashFor flagging bugs which are compiler or service crashes or unclean exits, rather than bad outputFor flagging bugs which are compiler or service crashes or unclean exits, rather than bad output