File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -993,10 +993,11 @@ export class Compiler extends DiagnosticEmitter {
993993 this . runtimeFeatures |= RuntimeFeatures . setArgumentsLength ;
994994 signature = functionInstance . signature ;
995995 }
996+ let signatureReturnTypes = signature . returnTypes ;
996997 if (
997998 this . options . bindingsHint &&
998- signature . returnTypes &&
999- signature . returnTypes . length > 1
999+ signatureReturnTypes != null &&
1000+ signatureReturnTypes . length > 1
10001001 ) {
10011002 this . error (
10021003 DiagnosticCode . Not_implemented_0 ,
@@ -2899,11 +2900,12 @@ export class Compiler extends DiagnosticEmitter {
28992900
29002901 let expr = this . compileExpression ( expression , Type . auto ) ;
29012902 if ( ! this . typesEqual ( this . currentReturnTypes , returnTypes ) ) {
2903+ let currentReturnTypes = this . currentReturnTypes ;
29022904 this . error (
29032905 DiagnosticCode . Type_0_is_not_assignable_to_type_1 ,
29042906 expression . range ,
2905- this . currentReturnTypes
2906- ? this . returnTypesToString ( this . currentReturnTypes )
2907+ currentReturnTypes
2908+ ? this . returnTypesToString ( currentReturnTypes )
29072909 : this . currentType . toString ( ) ,
29082910 this . returnTypesToString ( returnTypes )
29092911 ) ;
You can’t perform that action at this time.
0 commit comments