Isolated declarations quick fix defaults to including renamed properties #59547
Labels
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
π Search Terms
isolated declarations quick fix rename ts2842 ts9007
π Version & Regression Information
β― Playground Link
https://www.typescriptlang.org/play/?isolatedDeclarations=true&ts=5.6.0-dev.20240807#code/KYDwDg9gTgLgBAMwK4DsDGMCWEWIBQCUcA3gFBwVxTAxJS5x57ECGAXHAEYC HrHABm4EOANwiYAJnAC8APhLCAhAG5S3IA
π» Code
π Actual behavior
Quick fix introduces a type error:
π Expected behavior
Additional information about the issue
While the quick fix is consistent with the emitted declaration, it ideally wouldn't lead to another type error which can be avoided.
There are cases where it may make sense to preserve the renaming, most obviously
but also perhaps
though, maybe surprisingly, this would currently this still result in ts(2842)
Perhaps this could be relaxed. While
b
is unused in the direct sense, it technically has value in that it avoids the naming collision between thea
s.The text was updated successfully, but these errors were encountered: