microsoft / TypeScript Public
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
Inline const enum in import equals declaration #46664
base: main
Are you sure you want to change the base?
Conversation
@@ -162,7 +162,7 @@ namespace ts { | |||
const left = createExpressionFromEntityName(factory, node.left); | |||
// TODO(rbuckton): Does this need to be parented? | |||
const right = setParent(setTextRange(factory.cloneNode(node.right), node.right), node.right.parent); | |||
return setTextRange(factory.createPropertyAccessExpression(left, right), node); | |||
return setOriginalNode(setTextRange(factory.createPropertyAccessExpression(left, right), node), node); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
transformers/ts.ts
replaces import equals entity names with synthetic variable declarations + property access:
TypeScript/src/compiler/transformers/ts.ts
Line 2999 in 766e83f
const moduleReference = createExpressionFromEntityName(factory, node.moduleReference as EntityName); |
I experimented with resolving the synthetic property access, but settled on saving and resolving the original entity name instead?
Currently we elide the enum declaration but not the import equals, which is an unavoidable reference error:
Base
Head
Fixes #16671 (comment)
The text was updated successfully, but these errors were encountered: