=== tests/cases/compiler/castExpressionParentheses.ts === declare var a; >a : any // parentheses should be omitted // literals ({a:0}); >({a:0}) : any >{a:0} : any >{a:0} : { a: number; } >a : number >0 : number ([1,3,]); >([1,3,]) : any >[1,3,] : any >[1,3,] : number[] >1 : number >3 : number ("string"); >("string") : any >"string" : any >"string" : string (23.0); >(23.0) : any >23.0 : any >23.0 : number (/regexp/g); >(/regexp/g) : any >/regexp/g : any >/regexp/g : RegExp (false); >(false) : any >false : any >false : boolean (true); >(true) : any >true : any >true : boolean (null); >(null) : any >null : any >null : null // names and dotted names (this); >(this) : any >this : any >this : any (this.x); >(this.x) : any >this.x : any >this.x : any >this : any >x : any ((a).x); >((a).x) : any >(a).x : any >(a).x : any >(a) : any >a : any >a : any >x : any (a); >(a) : any >a : any >a : any >a : any (a[0]); >(a[0]) : any >a[0] : any >a[0] : any >a : any >0 : number (a.b["0"]); >(a.b["0"]) : any >a.b["0"] : any >a.b["0"] : any >a.b : any >a : any >b : any >"0" : string (a()).x; >(a()).x : any >(a()) : any >a() : any >a() : any >a : any >x : any declare var A; >A : any // should keep the parentheses in emit (new A).foo; >(new A).foo : any >(new A) : any >new A : any >new A : any >A : any >foo : any (typeof A).x; >(typeof A).x : any >(typeof A) : any >typeof A : any >typeof A : string >A : any >x : any (-A).x; >(-A).x : any >(-A) : any >-A : any >-A : number >A : any >x : any new (A()); >new (A()) : any >(A()) : any >A() : any >A() : any >A : any (()=> {})(); >(()=> {})() : void >(()=> {}) : () => void >()=> {} : () => void >Tany : Tany (function foo() { })(); >(function foo() { })() : any >(function foo() { }) : any >function foo() { } : any >function foo() { } : () => void >foo : () => void (-A).x; >(-A).x : any >(-A) : any >-A : any >-A : number >-A : any >-A : number >A : any >x : any // nested cast, should keep one pair of parenthese ((-A)).x; >((-A)).x : any >((-A)) : any >(-A) : any >(-A) : number >(-A) : any >-A : any >-A : number >A : any >x : any // nested parenthesized expression, should keep one pair of parenthese ((A)) >((A)) : any >(A) : any >(A) : any >A : any