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

Unified Diff: lib/src/runner/configuration/load.dart

Issue 1960503002: Fix all strong-mode errors and warnings. (Closed) Base URL: git@github.com:dart-lang/test@master
Patch Set: .analysis_options Created 4 years, 7 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 | « lib/src/runner/configuration/args.dart ('k') | lib/src/runner/load_suite.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/runner/configuration/load.dart
diff --git a/lib/src/runner/configuration/load.dart b/lib/src/runner/configuration/load.dart
index e93c80b51f25f00c7d6e0db511191fbad6b1bdf0..506d1e6023b63386a6e81c76b94e5fc99cbc07e7 100644
--- a/lib/src/runner/configuration/load.dart
+++ b/lib/src/runner/configuration/load.dart
@@ -290,8 +290,9 @@ class _ConfigurationLoader {
/// contains.
///
/// Returns a list of values returned by [forElement].
- List _getList(String field, forElement(YamlNode elementNode)) {
- var node = _getNode(field, "list", (value) => value is List);
+ List/*<T>*/ _getList/*<T>*/(String field,
+ /*=T*/ forElement(YamlNode elementNode)) {
+ var node = _getNode(field, "list", (value) => value is List) as YamlList;
if (node == null) return [];
return node.nodes.map(forElement).toList();
}
@@ -300,23 +301,23 @@ class _ConfigurationLoader {
///
/// Returns a map with the keys and values returned by [key] and [value]. Each
/// of these defaults to asserting that the value is a string.
- Map _getMap(String field, {key(YamlNode keyNode),
- value(YamlNode valueNode)}) {
- var node = _getNode(field, "map", (value) => value is Map);
+ Map/*<K, V>*/ _getMap/*<K, V>*/(String field, {/*=K*/ key(YamlNode keyNode),
+ /*=V*/ value(YamlNode valueNode)}) {
+ var node = _getNode(field, "map", (value) => value is Map) as YamlMap;
if (node == null) return {};
key ??= (keyNode) {
_validate(keyNode, "$field keys must be strings.",
(value) => value is String);
- return keyNode.value;
+ return keyNode.value as dynamic/*=K*/;
};
value ??= (valueNode) {
_validate(valueNode, "$field values must be strings.",
(value) => value is String);
- return valueNode.value;
+ return valueNode.value as dynamic/*=V*/;
};
return mapMap(node.nodes,
@@ -344,7 +345,8 @@ class _ConfigurationLoader {
///
/// If [parse] throws a [FormatException], it's wrapped to include [node]'s
/// span.
- _parseNode(YamlNode node, String name, parse(String value)) {
+ /*=T*/ _parseNode/*<T>*/(YamlNode node, String name,
+ /*=T*/ parse(String value)) {
_validate(node, "$name must be a string.", (value) => value is String);
try {
@@ -360,7 +362,7 @@ class _ConfigurationLoader {
///
/// If [parse] throws a [FormatException], it's wrapped to include [field]'s
/// span.
- _parseValue(String field, parse(String value)) {
+ /*=T*/ _parseValue/*<T>*/(String field, /*=T*/ parse(String value)) {
var node = _document.nodes[field];
if (node == null) return null;
return _parseNode(node, field, parse);
« no previous file with comments | « lib/src/runner/configuration/args.dart ('k') | lib/src/runner/load_suite.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698