Skip to content

Commit d2798f9

Browse files
authored
Remove dead code (#3910)
1 parent 2917fa9 commit d2798f9

File tree

2 files changed

+1
-20
lines changed

2 files changed

+1
-20
lines changed

lib/src/solver/incompatibility.dart

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
// for details. All rights reserved. Use of this source code is governed by a
33
// BSD-style license that can be found in the LICENSE file.
44

5-
import 'package:pub_semver/pub_semver.dart';
6-
75
import '../package_name.dart';
86
import 'incompatibility_cause.dart';
97
import 'term.dart';
@@ -108,15 +106,6 @@ class Incompatibility {
108106

109107
return '${_terse(depender, details, allowEvery: true)} depends on '
110108
'${_terse(dependee, details)}';
111-
} else if (cause == IncompatibilityCause.useLatest) {
112-
assert(terms.length == 1);
113-
114-
var forbidden = terms.last;
115-
assert(forbidden.isPositive);
116-
117-
return 'the latest version of ${_terseRef(forbidden, details)} '
118-
'(${VersionConstraint.any.difference(forbidden.constraint)}) '
119-
'is required';
120109
} else if (cause is SdkCause) {
121110
assert(terms.length == 1);
122111
assert(terms.first.isPositive);
@@ -429,11 +418,7 @@ class Incompatibility {
429418
buffer.write('${_terse(latter.terms.first, details)} ');
430419
if (priorLine != null) buffer.write('($priorLine) ');
431420

432-
if (latter.cause == IncompatibilityCause.useLatest) {
433-
var latest =
434-
VersionConstraint.any.difference(latter.terms.single.constraint);
435-
buffer.write('but the latest version ($latest) is required');
436-
} else if (latter.cause is SdkCause) {
421+
if (latter.cause is SdkCause) {
437422
var cause = latter.cause as SdkCause;
438423
if (cause.noNullSafetyCause) {
439424
buffer.write('which doesn\'t support null safety');

lib/src/solver/incompatibility_cause.dart

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,6 @@ abstract class IncompatibilityCause {
2020
/// The incompatibility represents a package's dependency.
2121
static const IncompatibilityCause dependency = _Cause('dependency');
2222

23-
/// The incompatibility represents the user's request that we use the latest
24-
/// version of a given package.
25-
static const IncompatibilityCause useLatest = _Cause('use latest');
26-
2723
/// The incompatibility indicates that the package has no versions that match
2824
/// the given constraint.
2925
static const IncompatibilityCause noVersions = _Cause('no versions');

0 commit comments

Comments
 (0)