File: functionOverloads38.types

package info (click to toggle)
node-typescript 5.0.4%2Bds1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 459,140 kB
  • sloc: javascript: 1,972,754; makefile: 6; sh: 1
file content (26 lines) | stat: -rw-r--r-- 779 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
=== tests/cases/compiler/functionOverloads38.ts ===
function foo(bar:{a:number;}[]):string;
>foo : { (bar: {    a: number;}[]): string; (bar: { a: boolean; }[]): number; }
>bar : { a: number; }[]
>a : number

function foo(bar:{a:boolean;}[]):number;
>foo : { (bar: { a: number; }[]): string; (bar: {    a: boolean;}[]): number; }
>bar : { a: boolean; }[]
>a : boolean

function foo(bar:{a:any;}[]):any{ return bar }
>foo : { (bar: { a: number; }[]): string; (bar: { a: boolean; }[]): number; }
>bar : { a: any; }[]
>a : any
>bar : { a: any; }[]

var x = foo([{a:1}]);
>x : string
>foo([{a:1}]) : string
>foo : { (bar: { a: number; }[]): string; (bar: { a: boolean; }[]): number; }
>[{a:1}] : { a: number; }[]
>{a:1} : { a: number; }
>a : number
>1 : 1