Explicitly annotated unique symbols are widened in return positions #55361
Labels
Possible Improvement
The current behavior isn't wrong, but it's possible to see that it might be better in some cases
Milestone
π Search Terms
widening return unique symbol
π Version & Regression Information
β― Playground Link
https://www.typescriptlang.org/play?ts=5.3.0-dev.20230814&ssl=6&ssc=2&pln=1&pc=1#code/KYDwDg9gTgLgBAYwgOwM7xsdcC8cDKAngLYBGEANgBQCUAUHaJLHAGYCuyCMAlim8lpwA3nTjjEKbAEMKPaagBccGITDAIrFVnh5M6ANxiJUYDHZRkcWfNR0AvkA
π» Code
π Actual behavior
this declaration file is emitted:
π Expected behavior
this declaration file to be emitted:
Additional information
getWidenedLiteralLikeTypeForContextualReturnTypeIfNeeded
callsgetWidenedLiteralLikeTypeForContextualType
and that callsgetWidenedUniqueESSymbolType
when there is no contextual type provided.some issues that are (partially~) related:
#32242
#35896 (comment)
#36876
The text was updated successfully, but these errors were encountered: