Skip to content
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

[ID-Prep] Explicit type annotation of const replaced with initializer in declaration emit #57442

Open
dragomirtitian opened this issue Feb 19, 2024 · 0 comments
Labels
Domain: Isolated Declarations Related to the --isolatedDeclarations compiler flag Help Wanted You can do this Possible Improvement The current behavior isn't wrong, but it's possible to see that it might be better in some cases
Milestone

Comments

@dragomirtitian
Copy link
Contributor

dragomirtitian commented Feb 19, 2024

The [ID-prep] set of issues aligns Declaration Emit with the forthcoming Isolated Declarations feature.

🔎 Search Terms

declarations type annotation const not preserved

🕗 Version & Regression Information

  • This is the behavior in every version I tried

⏯ Playground Link

Playground Link

💻 Code

enum E { "some value" = 1 };
const e: typeof E["some value"] = E["some value"];

🙁 Actual behavior

e is emitted in declarations as declare const e = E["some value"];

🙂 Expected behavior

e should have in declarations the type that was manually declared

Additional information about the issue

No response

@dragomirtitian dragomirtitian changed the title Explicit type annotation of const replaced with initializer in declaration emit [ID-Prep] Explicit type annotation of const replaced with initializer in declaration emit Feb 20, 2024
@RyanCavanaugh RyanCavanaugh added this to the Backlog milestone Feb 20, 2024
@RyanCavanaugh RyanCavanaugh added Help Wanted You can do this Possible Improvement The current behavior isn't wrong, but it's possible to see that it might be better in some cases labels Feb 20, 2024
@weswigham weswigham added the Domain: Isolated Declarations Related to the --isolatedDeclarations compiler flag label May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Domain: Isolated Declarations Related to the --isolatedDeclarations compiler flag Help Wanted You can do this Possible Improvement The current behavior isn't wrong, but it's possible to see that it might be better in some cases
Projects
None yet
Development

No branches or pull requests

3 participants