anchor.diff:        }
       }
   
  -    /// Trim [fact]'s allowed version if it's not covered by a requirement.
  +    /// Trim [fact]'s allowed version if it's not covered by a requirement. See
  +    /// [_requiredAndAllowed] for details.
       required = _required[fact.allowed.name];
  -    if (required != null) {
  -      var intersection = _intersectDeps(required.dep, fact.allowed);
  -
  -      if (intersection == null) {
  -        // If the intersection is empty, then [fact] can never be satisfied and
  -        // we should convert it into a [Disallowed]. For example, if
  -        //
  -        // * a [0, 1) depends on b [0, 1) (fact)
  -        // * b [1, 2) is required (required)
  -        //
  -        // we can remove [fact] and add
  -        //
  -        // * a [0, 1) is disallowed
  -        //
  -        // Add to [_toProcess] because [_fromCurrent] will get discarded when we
  -        // return `null`.
  -        _toProcess.add(new Disallowed(fact.depender, [required, fact]));
  -        return null;
  -      } else if (intersection != fact.allowed.constraint) {
  -        // If only a subset of [fact.allowed] is required, we can trim [fact].
  -        // For example, if
  -        //
  -        // * a [0, 1) depends on b [0, 2) (fact)
  -        // * b [1, 3) is required (required)
  -        //
  -        // we can remove [fact] and add
  -        //
  -        // * a [0, 1) depends on b [1, 2)
  -        fact = new Dependency(fact.depender, intersection, [required, fact]);
  -      }
  -    }
  -
  -    return fact;
  +    if (required == null) return fact;
  +
  +    var result = _requiredAndAllowed(required, fact);
  +    if (result is! Disallowed) return result as Dependency;
  +
  +    _toProcess.add(result);
  +    return null;
     }
   
     // Resolves [required] and [disallowed], which should refer to the same
  
positive.code:         required.dep.withConstraint(difference), [required, disallowed]);
    }
  
    void _removeDependency(Dependency dependency);
  
    void _removeDisallowed(Disallowed disallowed);
  
    /// If [dependencies]' dependers cover all of [depender], returns the union of
    /// their allowed constraints.
  
negative.code:   }
  
    void _requiredIntoDependencies(Required fact) {
      // TODO: remove dependencies from/onto packages with the same name but
      // non-matching sources.
  
      // Dependencies whose depender is exactly [fact.dep], grouped by the names
      // of packages they depend on.
      var matchingByAllowed = <String, Set<Dependency>>{};
  