Ensure that lists are reified.
This is important for strong mode, since "as List<String>" will fail for
a "List<dynamic>".
R=rnystrom@google.com
Review URL: https://codereview.chromium.org//1954923002 .
diff --git a/CHANGELOG.md b/CHANGELOG.md
index ae90612..1c9f5fc 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,7 @@
+## 0.13.4+1
+
+* Ensure that multiple-value arguments produce reified `List<String>`s.
+
## 0.13.4
* By default, only the first line of a command's description is included in its
diff --git a/lib/src/parser.dart b/lib/src/parser.dart
index 5567854..22579fb 100644
--- a/lib/src/parser.dart
+++ b/lib/src/parser.dart
@@ -258,7 +258,7 @@
return;
}
- var list = results.putIfAbsent(option.name, () => []);
+ var list = results.putIfAbsent(option.name, () => <String>[]);
if (option.splitCommas) {
for (var element in value.split(",")) {
diff --git a/pubspec.yaml b/pubspec.yaml
index 38b5654..78a8a72 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -1,5 +1,5 @@
name: args
-version: 0.13.4
+version: 0.13.4+1
author: "Dart Team <misc@dartlang.org>"
homepage: https://github.com/dart-lang/args
description: >
diff --git a/test/parse_test.dart b/test/parse_test.dart
index cdc6d5e..6ce8a19 100644
--- a/test/parse_test.dart
+++ b/test/parse_test.dart
@@ -161,6 +161,10 @@
parser.parse(['--a=v', '--a=x']);
expect(a, equals(['v', 'x']));
+
+ // This reified type is important in strong mode so that people can
+ // safely write "as List<String>".
+ expect(a, new isInstanceOf<List<String>>());
});
test('for single present, allowMultiple, options are invoked with '