Index: sdk/lib/_internal/pub/lib/src/pubspec.dart |
diff --git a/sdk/lib/_internal/pub/lib/src/pubspec.dart b/sdk/lib/_internal/pub/lib/src/pubspec.dart |
index 55b2df7ba57935ac2744e369b76012169e6515e1..8fd9f1ddbfa13dfdaa740aa0b0ff02243c0062c2 100644 |
--- a/sdk/lib/_internal/pub/lib/src/pubspec.dart |
+++ b/sdk/lib/_internal/pub/lib/src/pubspec.dart |
@@ -74,6 +74,14 @@ class Pubspec { |
} |
var span = fields.nodes['version'].span; |
+ if (version is num) { |
+ String fixed = '$version.0'; |
Bob Nystrom
2014/10/06 19:21:10
We just use "var" for local variables.
srawlins
2014/10/06 19:44:16
Done.
|
+ if (version is int) { |
+ fixed = '$fixed.0'; |
+ } |
+ _error('"version" field must have three numeric components: major, minor, ' |
Bob Nystrom
2014/10/06 19:21:10
Still just slightly too long. :)
srawlins
2014/10/06 19:44:16
Done.
|
+ 'and patch. Instead of "$version", consider "$fixed".', span); |
+ } |
if (version is! String) { |
_error('"version" field must be a string.', span); |
} |