1

Closed

Accessing the '__proto__' property using array access syntax crashes tsc

description

After trying to upgrade to version 0.9.0, I began seeing tsc.js getting crashes unhandled exceptions. I traced the root of the problem to using the array access syntax, example:
class X {
    constructor() {
        this['__proto__'] = null;
    }
}
This will consistently crash the TypeScript compiler resulting in this output:
C:\Users\Matthew\AppData\Roaming\npm\node_modules\typescript\bin\tsc.js:37713
            if (!(symbol.getKind() & (65536 /* Method */ | 4096 /* Property */
                         ^
TypeError: Object #<BlockIntrinsics> has no method 'getKind'
    at PullTypeResolver.getExportedMemberSymbol (C:\Users\Matthew\AppData\Roaming\npm\node_modules\typescript\bin\tsc.js:37713:26)
    at PullTypeResolver.getMemberSymbol (C:\Users\Matthew\AppData\Roaming\npm\node_modules\typescript\bin\tsc.js:37739:29)
    at PullTypeResolver.computeIndexExpressionSymbol (C:\Users\Matthew\AppData\Roaming\npm\node_modules\typescript\bin\tsc.js:40885:35)
    at PullTypeResolver.resolveIndexExpression (C:\Users\Matthew\AppData\Roaming\npm\node_modules\typescript\bin\tsc.js:40856:45)
    at PullTypeResolver.resolveAST (C:\Users\Matthew\AppData\Roaming\npm\node_modules\typescript\bin\tsc.js:39813:33)
    at PullTypeChecker.resolveSymbolAndReportDiagnostics (C:\Users\Matthew\AppData\Roaming\npm\node_modules\typescript\bin\tsc.js:43938:54)
    at PullTypeChecker.typeCheckElementAccessExpression (C:\Users\Matthew\AppData\Roaming\npm\node_modules\typescript\bin\tsc.js:45321:25)
    at PullTypeChecker.typeCheckAST (C:\Users\Matthew\AppData\Roaming\npm\node_modules\typescript\bin\tsc.js:43780:33)
    at PullTypeChecker.typeCheckAssignment (C:\Users\Matthew\AppData\Roaming\npm\node_modules\typescript\bin\tsc.js:44785:18)
    at PullTypeChecker.typeCheckAST (C:\Users\Matthew\AppData\Roaming\npm\node_modules\typescript\bin\tsc.js:43699:33)
Closed Jul 18, 2013 at 1:42 AM by danquirk
This is now fixed.

comments

danquirk wrote Jun 27, 2013 at 11:23 PM

Thanks for the report, marking as active.