Files
tsgo/testdata/baselines/reference/submodule/compiler/functionOverloads40.errors.txt

18 lines
1020 B
Plaintext

functionOverloads40.ts(4,15): error TS2769: No overload matches this call.
The last overload gave the following error.
Type 'string' is not assignable to type 'boolean'.
==== functionOverloads40.ts (1 errors) ====
function foo(bar:{a:number;}[]):string;
function foo(bar:{a:boolean;}[]):number;
function foo(bar:{a:any;}[]):any{ return bar }
var x = foo([{a:'bar'}]);
~
!!! error TS2769: No overload matches this call.
!!! error TS2769: The last overload gave the following error.
!!! error TS2769: Type 'string' is not assignable to type 'boolean'.
!!! related TS6500 functionOverloads40.ts:2:19: The expected type comes from property 'a' which is declared here on type '{ a: boolean; }'
!!! related TS2771 functionOverloads40.ts:2:10: The last overload is declared here.
!!! related TS2793 functionOverloads40.ts:3:10: The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible.