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 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
|
=== tests/cases/compiler/arrowFunctionWithObjectLiteralBody5.ts ===
var a = () => <Error>{ name: "foo", message: "bar" };
>a : () => Error
>() => <Error>{ name: "foo", message: "bar" } : () => Error
><Error>{ name: "foo", message: "bar" } : Error
>Error : Error
>{ name: "foo", message: "bar" } : { name: string; message: string; }
>name : string
>"foo" : "foo"
>message : string
>"bar" : "bar"
var b = () => (<Error>{ name: "foo", message: "bar" });
>b : () => Error
>() => (<Error>{ name: "foo", message: "bar" }) : () => Error
>(<Error>{ name: "foo", message: "bar" }) : Error
><Error>{ name: "foo", message: "bar" } : Error
>Error : Error
>{ name: "foo", message: "bar" } : { name: string; message: string; }
>name : string
>"foo" : "foo"
>message : string
>"bar" : "bar"
var c = () => ({ name: "foo", message: "bar" });
>c : () => { name: string; message: string; }
>() => ({ name: "foo", message: "bar" }) : () => { name: string; message: string; }
>({ name: "foo", message: "bar" }) : { name: string; message: string; }
>{ name: "foo", message: "bar" } : { name: string; message: string; }
>name : string
>"foo" : "foo"
>message : string
>"bar" : "bar"
var d = () => ((<Error>({ name: "foo", message: "bar" })));
>d : () => Error
>() => ((<Error>({ name: "foo", message: "bar" }))) : () => Error
>((<Error>({ name: "foo", message: "bar" }))) : Error
>(<Error>({ name: "foo", message: "bar" })) : Error
><Error>({ name: "foo", message: "bar" }) : Error
>Error : Error
>({ name: "foo", message: "bar" }) : { name: string; message: string; }
>{ name: "foo", message: "bar" } : { name: string; message: string; }
>name : string
>"foo" : "foo"
>message : string
>"bar" : "bar"
|