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 @@ -6172,6 +6172,38 @@ export class Compiler extends DiagnosticEmitter {
6172
6172
}
6173
6173
break ;
6174
6174
}
6175
+
6176
+ case ElementKind . IndexSignature : {
6177
+ const functionExpr = expression . expression ;
6178
+ const type = this . resolver . getTypeOfElement ( target ) ;
6179
+ assert ( functionExpr . kind == NodeKind . ElementAccess ) ;
6180
+
6181
+ if ( ! type ) {
6182
+ this . error (
6183
+ DiagnosticCode . Expression_cannot_be_represented_by_a_type ,
6184
+ functionExpr . range
6185
+ ) ;
6186
+ return module . unreachable ( ) ;
6187
+ }
6188
+
6189
+ if ( ! type . signatureReference ) {
6190
+ this . error (
6191
+ DiagnosticCode . Type_0_has_no_call_signatures ,
6192
+ functionExpr . range ,
6193
+ type . toString ( )
6194
+ ) ;
6195
+ return module . unreachable ( ) ;
6196
+ }
6197
+
6198
+ signature = type . signatureReference ;
6199
+ functionArg = this . compileElementAccessExpression (
6200
+ < ElementAccessExpression > functionExpr ,
6201
+ contextualType ,
6202
+ Constraints . ConvImplicit
6203
+ ) ;
6204
+ break ;
6205
+ }
6206
+
6175
6207
case ElementKind . Class : {
6176
6208
let classInstance = < Class > target ;
6177
6209
let typeArguments = classInstance . getTypeArgumentsTo ( this . program . functionPrototype ) ;
You can’t perform that action at this time.
0 commit comments