TypeScript/tests/baselines/reference/asOpEmitParens.types
2016-07-15 15:56:22 -07:00

31 lines
549 B
Plaintext

=== tests/cases/conformance/expressions/asOperator/asOpEmitParens.ts ===
declare var x;
>x : any
// Must emit as (x + 1) * 3
(x + 1 as number) * 3;
>(x + 1 as number) * 3 : number
>(x + 1 as number) : number
>x + 1 as number : number
>x + 1 : any
>x : any
>1 : number
>3 : number
// Should still emit as x.y
(x as any).y;
>(x as any).y : any
>(x as any) : any
>x as any : any
>x : any
>y : any
// Emit as new (x())
new (x() as any);
>new (x() as any) : any
>(x() as any) : any
>x() as any : any
>x() : any
>x : any