question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItΒ collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Do not remove PURE comment after typed declaration

See original GitHub issue

TypeScript Version: 3.4.0-dev.201xxxxx

Search Terms:

Code

const a :Type = /*#__PURE__*/ function () {}();

Expected behavior:

const a = /*#__PURE__*/ function () {}();

Actual behavior:

const a = function () {}();

Playground Link:

Related Issues:

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
ashi009commented, Sep 17, 2019

@AlCalzone

This is #13721 I think

#13721 is mainly for classes, which is fixed in #16631. This is actually #7770.

@LongTengDao

A workaround is to add parentheses around the pure expression, which will preserve the comment until this is fixed.

const a : Type = (/*#__PURE__*/ function () {}());
// var a = ( /*#__PURE__*/function () { }());
0reactions
LongTengDaocommented, Sep 17, 2019

@ashi009 Oh, that works, thank you!

Anyway, I wrote my personal ts transpiler (@ ltd/j-ts) πŸ˜‰

Read more comments on GitHub >

github_iconTop Results From Across the Web

JavaParser doesn't remove comments before package ...
The easiest way to remove all comments is to configure JavaParser not to handle comments at all: import com.github.javaparser.ast.
Read more >
Nim Manual
The variable's type is called static type, the location's type is called dynamic type. If the static type is not the same as...
Read more >
css-loader | webpack - JS.ORG
With the help of the /* webpackIgnore: true */ comment, it is possible to disable sources handling for rules and for individual declarations....
Read more >
Doxygen Manual: Special Commands
Indicates that a comment block contains documentation for a function (either global or as a member of a class). This command is only...
Read more >
LLVM Language Reference Manual
For example, the following instruction is syntactically okay, but not well formed: ... This linkage type is only allowed on definitions, not declarations....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found