40 lines
1.1 KiB
Plaintext
40 lines
1.1 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
|
||
|
|
||
|
function foo(func: () => boolean) { }
|
||
|
>foo : (func: () => boolean) => void
|
||
|
>func : () => boolean
|
||
|
|
||
|
foo(() => true);
|
||
|
>foo(() => true) : void
|
||
|
>foo : (func: () => boolean) => void
|
||
|
>() => true : () => boolean
|
||
|
|
||
|
foo(() => { return false; });
|
||
|
>foo(() => { return false; }) : void
|
||
|
>foo : (func: () => boolean) => void
|
||
|
>() => { return false; } : () => boolean
|
||
|
|