Fix all strong-mode warnings. R=jmesserly@google.com Review URL: https://codereview.chromium.org//1948223002 .
diff --git a/pkgs/yaml/.analysis_options b/pkgs/yaml/.analysis_options new file mode 100644 index 0000000..a10d4c5 --- /dev/null +++ b/pkgs/yaml/.analysis_options
@@ -0,0 +1,2 @@ +analyzer: + strong-mode: true
diff --git a/pkgs/yaml/CHANGELOG.md b/pkgs/yaml/CHANGELOG.md index bb4d88e..e1a43b2 100644 --- a/pkgs/yaml/CHANGELOG.md +++ b/pkgs/yaml/CHANGELOG.md
@@ -1,3 +1,7 @@ +## 2.1.9 + +* Fix all strong-mode warnings. + ## 2.1.8 * Remove the dependency on `path`, since we don't actually import it.
diff --git a/pkgs/yaml/lib/src/equality.dart b/pkgs/yaml/lib/src/equality.dart index a6874cb..846f716 100644 --- a/pkgs/yaml/lib/src/equality.dart +++ b/pkgs/yaml/lib/src/equality.dart
@@ -9,7 +9,8 @@ import 'yaml_node.dart'; /// Returns a [Map] that compares its keys based on [deepEquals]. -Map deepEqualsMap() => new HashMap(equals: deepEquals, hashCode: deepHashCode); +Map/*<K, V>*/ deepEqualsMap/*<K, V>*/() => + new HashMap(equals: deepEquals, hashCode: deepHashCode); /// Returns whether two objects are structurally equivalent. ///
diff --git a/pkgs/yaml/lib/src/loader.dart b/pkgs/yaml/lib/src/loader.dart index fee7769..ea6eb99 100644 --- a/pkgs/yaml/lib/src/loader.dart +++ b/pkgs/yaml/lib/src/loader.dart
@@ -147,7 +147,7 @@ throw new YamlException("Invalid tag for mapping.", firstEvent.span); } - var children = deepEqualsMap(); + var children = deepEqualsMap/*<dynamic, YamlNode>*/(); var node = new YamlMap.internal( children, firstEvent.span, firstEvent.style); _registerAnchor(firstEvent.anchor, node);
diff --git a/pkgs/yaml/pubspec.yaml b/pkgs/yaml/pubspec.yaml index ad89309..87ddd5b 100644 --- a/pkgs/yaml/pubspec.yaml +++ b/pkgs/yaml/pubspec.yaml
@@ -1,5 +1,5 @@ name: yaml -version: 2.1.8 +version: 2.1.9 author: "Dart Team <misc@dartlang.org>" homepage: https://github.com/dart-lang/yaml description: A parser for YAML.
diff --git a/pkgs/yaml/test/yaml_test.dart b/pkgs/yaml/test/yaml_test.dart index d2f5d19..153af5e 100644 --- a/pkgs/yaml/test/yaml_test.dart +++ b/pkgs/yaml/test/yaml_test.dart
@@ -57,14 +57,14 @@ - foo: bar - 123 -"""); +""") as YamlList; expect(yaml.span.start.line, equals(0)); expect(yaml.span.start.column, equals(0)); expect(yaml.span.end.line, equals(3)); expect(yaml.span.end.column, equals(0)); - var map = yaml.nodes.first; + var map = yaml.nodes.first as YamlMap; expect(map.span.start.line, equals(0)); expect(map.span.start.column, equals(2)); expect(map.span.end.line, equals(2));