Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptFixedA PR has been merged for this issueA PR has been merged for this issue
Milestone
Description
The condition on line 1663 in editorServices.ts:
https://github.com/Microsoft/TypeScript/blob/eef7d8bd3d974528464c7968deab78b747568c06/src/server/editorServices.ts#L1650-L1666
is always false as the called method closeExternalProject always returns void. That way the if-block with shouldRefreshInferredProjects = true; is never executed (for more information see the linter rule detecting this).
Reacted by Daniel Rosenwasser and Herrington Darkholme
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptFixedA PR has been merged for this issueA PR has been merged for this issue
Activity
mhegazy commentedon Aug 18, 2017
thanks for the report. a PR would be appreciated.
RyanCavanaugh commentedon Aug 19, 2017
Mohamed Hegazy (@mhegazy) seems like using a
voidvalue in a truthiness position is hyper-sketchy - thoughts on making that an error in TS?mhegazy commentedon Aug 21, 2017
i thought you had experimented with this a while back; I think it is a check worth adding, baring any breaks that we might find from RWC tests.
RyanCavanaugh commentedon Aug 22, 2017
I had a test for always-truthy values that attempted to find bugs like
if (x.f)(in lieu ofif (x.f()) {) but the problem was that non-strictNullChecks .d.ts file gave tons of false positives. Checking forvoidvalues in control flow test positions should be a home runmhegazy commentedon Aug 22, 2017
i think the
voidcheck should only flag errors. seems like a low risk-high yield change to make.ts.server.ProjectService.closeConfiguredProject returns true on success.
ts.server.ProjectService.closeConfiguredProject returns true on succe…