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 @@ -6202,6 +6202,38 @@ export class Compiler extends DiagnosticEmitter {
6202
6202
}
6203
6203
break ;
6204
6204
}
6205
+
6206
+ case ElementKind . INDEXSIGNATURE : {
6207
+ const functionExpr = expression . expression ;
6208
+ const type = this . resolver . getTypeOfElement ( target ) ;
6209
+ assert ( functionExpr . kind == NodeKind . ELEMENTACCESS ) ;
6210
+
6211
+ if ( ! type ) {
6212
+ this . error (
6213
+ DiagnosticCode . Expression_cannot_be_represented_by_a_type ,
6214
+ functionExpr . range
6215
+ ) ;
6216
+ return module . unreachable ( ) ;
6217
+ }
6218
+
6219
+ if ( ! type . signatureReference ) {
6220
+ this . error (
6221
+ DiagnosticCode . Type_0_has_no_call_signatures ,
6222
+ functionExpr . range ,
6223
+ type . toString ( )
6224
+ ) ;
6225
+ return module . unreachable ( ) ;
6226
+ }
6227
+
6228
+ signature = type . signatureReference ;
6229
+ functionArg = this . compileElementAccessExpression (
6230
+ < ElementAccessExpression > functionExpr ,
6231
+ contextualType ,
6232
+ Constraints . CONV_IMPLICIT
6233
+ ) ;
6234
+ break ;
6235
+ }
6236
+
6205
6237
case ElementKind . CLASS : {
6206
6238
let classInstance = < Class > target ;
6207
6239
let typeArguments = classInstance . getTypeArgumentsTo ( this . program . functionPrototype ) ;
You can’t perform that action at this time.
0 commit comments