File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -6109,6 +6109,38 @@ export class Compiler extends DiagnosticEmitter {
6109
6109
}
6110
6110
break ;
6111
6111
}
6112
+
6113
+ case ElementKind . IndexSignature : {
6114
+ const functionExpr = expression . expression ;
6115
+ const type = this . resolver . getTypeOfElement ( target ) ;
6116
+ assert ( functionExpr . kind == NodeKind . ElementAccess ) ;
6117
+
6118
+ if ( ! type ) {
6119
+ this . error (
6120
+ DiagnosticCode . Expression_cannot_be_represented_by_a_type ,
6121
+ functionExpr . range
6122
+ ) ;
6123
+ return module . unreachable ( ) ;
6124
+ }
6125
+
6126
+ if ( ! type . signatureReference ) {
6127
+ this . error (
6128
+ DiagnosticCode . Type_0_has_no_call_signatures ,
6129
+ functionExpr . range ,
6130
+ type . toString ( )
6131
+ ) ;
6132
+ return module . unreachable ( ) ;
6133
+ }
6134
+
6135
+ signature = type . signatureReference ;
6136
+ functionArg = this . compileElementAccessExpression (
6137
+ < ElementAccessExpression > functionExpr ,
6138
+ contextualType ,
6139
+ Constraints . ConvImplicit
6140
+ ) ;
6141
+ break ;
6142
+ }
6143
+
6112
6144
case ElementKind . Class : {
6113
6145
let classInstance = < Class > target ;
6114
6146
let typeArguments = classInstance . getTypeArgumentsTo ( this . program . functionPrototype ) ;
You can’t perform that action at this time.
0 commit comments