File: functionOverloads40.errors.txt

package info (click to toggle)
node-typescript 3.3.3333-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 324,548 kB
  • sloc: makefile: 6; sh: 3
file content (12 lines) | stat: -rw-r--r-- 617 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
tests/cases/compiler/functionOverloads40.ts(4,15): error TS2322: Type 'string' is not assignable to type 'boolean'.


==== tests/cases/compiler/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 TS2322: Type 'string' is not assignable to type 'boolean'.
!!! related TS6500 tests/cases/compiler/functionOverloads40.ts:2:19: The expected type comes from property 'a' which is declared here on type '{ a: boolean; }'