Regression in detecting unused parameters in 5.5.0-beta #58493
Labels
Bug
A bug in TypeScript
Fix Available
A PR has been opened for this issue
Help Wanted
You can do this
Milestone
π Search Terms
π Version & Regression Information
β― Playground Link
https://www.typescriptlang.org/play/?ts=5.5.0-beta#code/GYVwdgxgLglg9mABABwE4FMAmB1GUAWAqmCAM5YAUAhgFyLgDWYcA7mAJSIDeAUIv4gxQQqJAEIxAWSoEAdKiphMcALYV2Abh4BfHkA
π» Code
π Actual behavior
TS 5.5.0-beta reports that
a
is used.π Expected behavior
It should be reported as unused.
Additional information about the issue
Compare 5.4.5
vs. 5.5.0-beta:
This was almost certainly broken by #57465. It adds a call to
getTypeOfSymbol
for every parameter of a candidate predicate function incheckIfExpressionRefinesAnyParameter
. This marks each of those parameters as referenced, even though there's no reason to assume that they are, since this call is speculative.This also affects the "Delete all unused declarations" quickfix.
The text was updated successfully, but these errors were encountered: