[ID-Prep] Type of variable is widened in declaration with !strictNullChecks #57441
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
The [ID-prep] set of issues aligns Declaration Emit with the forthcoming Isolated Declarations feature.
π Search Terms
const declaration widen
π Version & Regression Information
β― Playground Link
Playground Link
π» Code
π Actual behavior
x3
is emitted asdeclare const x3: string;
in declaration files but it's actually"abc" | "def"
in sourceπ Expected behavior
x3
is emitted asdeclare const x3: "abc" | "def"
Additional information about the issue
No response
The text was updated successfully, but these errors were encountered: