Merge pull request #9767 from RyanCavanaugh/fix9766

Emit parens around type-asserted binary operators
This commit is contained in:
Ryan Cavanaugh
2016-08-01 15:44:48 -07:00
committed by GitHub
7 changed files with 76 additions and 35 deletions

View File

@@ -1,14 +0,0 @@
// @filename: a.d.ts
export = ns;
export as namespace ns;
declare namespace ns {
export var x: number;
export interface IFoo { }
}
// @filename: b.d.ts
declare namespace ns.something {
export var p: ns.IFoo;
}

View File

@@ -0,0 +1,9 @@
declare var x;
// Must emit as (x + 1) * 3
(x + 1 as number) * 3;
// Should still emit as x.y
(x as any).y;
// Emit as new (x())
new (x() as any);