Skip to content

Emit parens around type-asserted binary operators #9767

Merged
RyanCavanaugh merged 3 commits into
microsoft:masterfrom
RyanCavanaugh:fix9766
Aug 1, 2016
Merged

Emit parens around type-asserted binary operators #9767
RyanCavanaugh merged 3 commits into
microsoft:masterfrom
RyanCavanaugh:fix9766

Conversation

@RyanCavanaugh
Copy link
Copy Markdown
Member

Fixes #9766

//// [asOpEmitParens.ts]
declare var x;
// Must emit as (x + 1) * 3
(x + 1 as number) * 3;
Copy link
Copy Markdown
Member

@weswigham weswigham Jul 15, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The type assertion is still in the output.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're looking at the wrong part of the baseline (this is the original .ts). Its corresponding emitted line is 15

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, derp

On Fri, Jul 15, 2016, 5:54 PM Ryan Cavanaugh notifications@github.com
wrote:

In tests/baselines/reference/asOpEmitParens.js
#9767 (comment):

@@ -0,0 +1,19 @@
+//// [asOpEmitParens.ts]
+declare var x;
+// Must emit as (x + 1) * 3
+(x + 1 as number) * 3;

You're looking at the wrong part of the baseline (this is the original
.ts). Its corresponding emitted line is 15


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/Microsoft/TypeScript/pull/9767/files/40ca4a06b55d9493a7ed45bd92543a0a14a7ac3a#r71057592,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ACzAMnkNN2tSPIQlLgSHEVrLTCD7tddLks5qWCvCgaJpZM4JN2j9
.

@RyanCavanaugh
Copy link
Copy Markdown
Member Author

Anyone?

@RyanCavanaugh
Copy link
Copy Markdown
Member Author

Last call 🔔

@weswigham
Copy link
Copy Markdown
Member

👍

@RyanCavanaugh RyanCavanaugh merged commit 2d20dbf into microsoft:master Aug 1, 2016
@RyanCavanaugh RyanCavanaugh deleted the fix9766 branch August 1, 2016 22:44
@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants