TypeScript/tests/baselines/reference/emitArrowFunction.types
2015-04-15 16:44:20 -07:00

43 lines
1.2 KiB
Plaintext

=== tests/cases/conformance/es6/arrowFunction/emitArrowFunction.ts ===
var f1 = () => { }
>f1 : () => void
>() => { } : () => void
var f2 = (x: string, y: string) => { }
>f2 : (x: string, y: string) => void
>(x: string, y: string) => { } : (x: string, y: string) => void
>x : string
>y : string
var f3 = (x: string, y: number, ...rest) => { }
>f3 : (x: string, y: number, ...rest: any[]) => void
>(x: string, y: number, ...rest) => { } : (x: string, y: number, ...rest: any[]) => void
>x : string
>y : number
>rest : any[]
var f4 = (x: string, y: number, z = 10) => { }
>f4 : (x: string, y: number, z?: number) => void
>(x: string, y: number, z = 10) => { } : (x: string, y: number, z?: number) => void
>x : string
>y : number
>z : number
>10 : number
function foo(func: () => boolean) { }
>foo : (func: () => boolean) => void
>func : () => boolean
foo(() => true);
>foo(() => true) : void
>foo : (func: () => boolean) => void
>() => true : () => boolean
>true : boolean
foo(() => { return false; });
>foo(() => { return false; }) : void
>foo : (func: () => boolean) => void
>() => { return false; } : () => boolean
>false : boolean