Skip to content

TypeScript drops inline comments on simple assignment expressions #12161

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
mprobst opened this issue Nov 11, 2016 · 1 comment
Closed

TypeScript drops inline comments on simple assignment expressions #12161

mprobst opened this issue Nov 11, 2016 · 1 comment

Comments

@mprobst
Copy link
Contributor

mprobst commented Nov 11, 2016

TypeScript Version: 2.0.3 / nightly (2.1.0-dev.201xxxxx)
$ tsc --version
Version 2.0.8

Code

let x = /* foo */ (1);
let y = /* foo */ 1;
let z = 1 /* foo */;

Expected behavior:

var x = /* foo */ (1);
var y = /* foo */ 1;
var z = 1 /* foo */;

Actual behavior:

var x = (1);
var y = 1;
var z = 1;

This is not a huge problem for most user code, but in tsickle we're adding comments that represent Closure Compiler casts for type assertions, e.g.:

let x = /** @type {string} */ (someExpr);

Which this behaviour breaks.

@mprobst
Copy link
Contributor Author

mprobst commented Nov 11, 2016

Actually a duplicate of #9873

@mprobst mprobst closed this as completed Nov 11, 2016
@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

No branches or pull requests

1 participant