TypeScript/tests/baselines/reference/emitArrowFunction.types
2015-04-13 14:29:37 -07:00

42 lines
1.9 KiB
Text

=== tests/cases/conformance/es6/arrowFunction/emitArrowFunction.ts ===
var f1 = () => { }
>f1 : () => void, Symbol(f1, Decl(emitArrowFunction.ts, 0, 3))
>() => { } : () => void
var f2 = (x: string, y: string) => { }
>f2 : (x: string, y: string) => void, Symbol(f2, Decl(emitArrowFunction.ts, 1, 3))
>(x: string, y: string) => { } : (x: string, y: string) => void
>x : string, Symbol(x, Decl(emitArrowFunction.ts, 1, 10))
>y : string, Symbol(y, Decl(emitArrowFunction.ts, 1, 20))
var f3 = (x: string, y: number, ...rest) => { }
>f3 : (x: string, y: number, ...rest: any[]) => void, Symbol(f3, Decl(emitArrowFunction.ts, 2, 3))
>(x: string, y: number, ...rest) => { } : (x: string, y: number, ...rest: any[]) => void
>x : string, Symbol(x, Decl(emitArrowFunction.ts, 2, 10))
>y : number, Symbol(y, Decl(emitArrowFunction.ts, 2, 20))
>rest : any[], Symbol(rest, Decl(emitArrowFunction.ts, 2, 31))
var f4 = (x: string, y: number, z = 10) => { }
>f4 : (x: string, y: number, z?: number) => void, Symbol(f4, Decl(emitArrowFunction.ts, 3, 3))
>(x: string, y: number, z = 10) => { } : (x: string, y: number, z?: number) => void
>x : string, Symbol(x, Decl(emitArrowFunction.ts, 3, 10))
>y : number, Symbol(y, Decl(emitArrowFunction.ts, 3, 20))
>z : number, Symbol(z, Decl(emitArrowFunction.ts, 3, 31))
>10 : number
function foo(func: () => boolean) { }
>foo : (func: () => boolean) => void, Symbol(foo, Decl(emitArrowFunction.ts, 3, 46))
>func : () => boolean, Symbol(func, Decl(emitArrowFunction.ts, 4, 13))
foo(() => true);
>foo(() => true) : void
>foo : (func: () => boolean) => void, Symbol(foo, Decl(emitArrowFunction.ts, 3, 46))
>() => true : () => boolean
>true : boolean
foo(() => { return false; });
>foo(() => { return false; }) : void
>foo : (func: () => boolean) => void, Symbol(foo, Decl(emitArrowFunction.ts, 3, 46))
>() => { return false; } : () => boolean
>false : boolean