File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -6214,6 +6214,37 @@ export class Compiler extends DiagnosticEmitter {
62146214 // fall-through
62156215 }
62166216
6217+ case ElementKind . INDEXSIGNATURE : {
6218+ const functionExpr = expression . expression ;
6219+ const type = this . resolver . getTypeOfElement ( target ) ;
6220+ assert ( functionExpr . kind == NodeKind . ELEMENTACCESS ) ;
6221+
6222+ if ( ! type ) {
6223+ this . error (
6224+ DiagnosticCode . Expression_cannot_be_represented_by_a_type ,
6225+ functionExpr . range
6226+ ) ;
6227+ return module . unreachable ( ) ;
6228+ }
6229+
6230+ if ( ! type . signatureReference ) {
6231+ this . error (
6232+ DiagnosticCode . Type_0_has_no_call_signatures ,
6233+ functionExpr . range ,
6234+ type . toString ( )
6235+ ) ;
6236+ return module . unreachable ( ) ;
6237+ }
6238+
6239+ signature = type . signatureReference ;
6240+ functionArg = this . compileElementAccessExpression (
6241+ < ElementAccessExpression > functionExpr ,
6242+ contextualType ,
6243+ Constraints . CONV_IMPLICIT
6244+ ) ;
6245+ break ;
6246+ }
6247+
62176248 // not supported
62186249 default : {
62196250 let type = this . resolver . getTypeOfElement ( target ) ;
You can’t perform that action at this time.
0 commit comments