Microsoft/TypeScript
Ver no GitHub[ID-Prep] Explicit type annotation of const replaced with initializer in declaration emit
Open
#57.442 aberto em 19 de fev. de 2024
Domain: flag: isolatedDeclarationsHelp WantedPossible Improvement
Métricas do repositório
- Stars
- (48.455 stars)
- Métricas de merge de PR
- (Mesclagem média 6d 17h) (9 fundiu PRs em 30d)
Description
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
💻 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