mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-20 05:17:43 -05:00
Merge pull request #9767 from RyanCavanaugh/fix9766
Emit parens around type-asserted binary operators
This commit is contained in:
@@ -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;
|
||||
}
|
||||
@@ -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);
|
||||
Reference in New Issue
Block a user