From b68f91db994fc1e8df262222d7ba7f1ca62bddf7 Mon Sep 17 00:00:00 2001 From: David Greenspan Date: Tue, 10 Mar 2015 00:09:09 -0700 Subject: [PATCH] Fix glasser's "actual bug" That's what we've been calling it. To see this break and then work, add the following line above the comment that begins `// lock down versions...`: ``` self.solution = logic.solveAssuming('bar'); ``` And then run the test "previous solution no longer needed" in input-tests.js. The old code would lock down "bar", including the fact that it is in the current solution. The new code only locks down the version number in the case where "bar" is used, so it is able to be optimized away. --- packages/constraint-solver/solver.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/constraint-solver/solver.js b/packages/constraint-solver/solver.js index 60391c8345..397349e41c 100644 --- a/packages/constraint-solver/solver.js +++ b/packages/constraint-solver/solver.js @@ -589,7 +589,7 @@ CS.Solver.prototype.getSolution = function (options) { if (input.isRootDependency(package) || input.isInPreviousSolution(package) || input.isUpgrading(package)) { - logic.require(pvVar(package, v)); + logic.require(Logic.implies(package, pvVar(package, v))); } });