Fix three strong mode analysis issues. BUG=https://github.com/dart-lang/pub_semver/issues/10 R=nweiz@google.com Review URL: https://codereview.chromium.org//1417163006 .
diff --git a/pkgs/pub_semver/CHANGELOG.md b/pkgs/pub_semver/CHANGELOG.md index 7dca24c..b505230 100644 --- a/pkgs/pub_semver/CHANGELOG.md +++ b/pkgs/pub_semver/CHANGELOG.md
@@ -1,3 +1,7 @@ +# 1.2.3 + +* Addressed three strong mode warnings. + # 1.2.2 * Make the package analyze under strong mode and compile with the DDC (Dart Dev
diff --git a/pkgs/pub_semver/lib/src/version_constraint.dart b/pkgs/pub_semver/lib/src/version_constraint.dart index dbd0aa5..f84d882 100644 --- a/pkgs/pub_semver/lib/src/version_constraint.dart +++ b/pkgs/pub_semver/lib/src/version_constraint.dart
@@ -114,7 +114,7 @@ var compatibleWith = matchCompatibleWith(); if (compatibleWith != null) return compatibleWith; - var constraints = []; + var constraints = <VersionConstraint>[]; while (true) { skipWhitespace();
diff --git a/pkgs/pub_semver/lib/src/version_union.dart b/pkgs/pub_semver/lib/src/version_union.dart index ee9f657..a671514 100644 --- a/pkgs/pub_semver/lib/src/version_union.dart +++ b/pkgs/pub_semver/lib/src/version_union.dart
@@ -59,7 +59,7 @@ (flattened as List).sort(compareMax); - var merged = []; + var merged = <VersionRange>[]; for (var constraint in flattened) { // Merge this constraint with the previous one, but only if they touch. if (merged.isEmpty || @@ -132,7 +132,7 @@ // Because both lists of constraints are ordered by minimum version, we can // safely move through them linearly here. - var newConstraints = []; + var newConstraints = <VersionRange>[]; ourConstraints.moveNext(); theirConstraints.moveNext(); while (ourConstraints.current != null && theirConstraints.current != null) {
diff --git a/pkgs/pub_semver/pubspec.yaml b/pkgs/pub_semver/pubspec.yaml index 530a4ce..0ed3e3b 100644 --- a/pkgs/pub_semver/pubspec.yaml +++ b/pkgs/pub_semver/pubspec.yaml
@@ -1,5 +1,5 @@ name: pub_semver -version: 1.2.2 +version: 1.2.3 author: Dart Team <misc@dartlang.org> description: > Versions and version constraints implementing pub's versioning policy. This