Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(9)

Unified Diff: lib/src/solver/backtracking_solver.dart

Issue 1293383006: Dependency overrides override SDK constraints. (Closed) Base URL: git@github.com:dart-lang/pub.git@master
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | test/dependency_override_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/solver/backtracking_solver.dart
diff --git a/lib/src/solver/backtracking_solver.dart b/lib/src/solver/backtracking_solver.dart
index f487dd66f7c9c942501782827d59a3e25852b05b..da0dbec45e753b96f45bd675c69a78a2d08f46df 100644
--- a/lib/src/solver/backtracking_solver.dart
+++ b/lib/src/solver/backtracking_solver.dart
@@ -642,17 +642,18 @@ class BacktrackingSolver {
// Indent for the previous selections.
log.solver(prefixLines(message, prefix: '| ' * _versions.length));
}
-}
-/// Ensures that if [pubspec] has an SDK constraint, then it is compatible
-/// with the current SDK.
-///
-/// Throws a [SolveFailure] if not.
-void _validateSdkConstraint(Pubspec pubspec) {
- if (pubspec.environment.sdkVersion.allows(sdk.version)) return;
-
- throw new BadSdkVersionException(pubspec.name,
- 'Package ${pubspec.name} requires SDK version '
- '${pubspec.environment.sdkVersion} but the current SDK is '
- '${sdk.version}.');
+ /// Ensures that if [pubspec] has an SDK constraint, then it is compatible
+ /// with the current SDK.
+ ///
+ /// Throws a [SolveFailure] if not.
+ void _validateSdkConstraint(Pubspec pubspec) {
+ if (_overrides.containsKey(pubspec.name)) return;
+ if (pubspec.environment.sdkVersion.allows(sdk.version)) return;
+
+ throw new BadSdkVersionException(pubspec.name,
+ 'Package ${pubspec.name} requires SDK version '
+ '${pubspec.environment.sdkVersion} but the current SDK is '
+ '${sdk.version}.');
+ }
}
« no previous file with comments | « no previous file | test/dependency_override_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698