Chromium Code Reviews| Index: pkg/yaml/lib/src/yaml_node_wrapper.dart |
| diff --git a/pkg/yaml/lib/src/yaml_node_wrapper.dart b/pkg/yaml/lib/src/yaml_node_wrapper.dart |
| index 8ea084e3370f9dbdc7bc329e619a0564e67cb716..cc1645c066c943548bb1af3983c1f08677d32475 100644 |
| --- a/pkg/yaml/lib/src/yaml_node_wrapper.dart |
| +++ b/pkg/yaml/lib/src/yaml_node_wrapper.dart |
| @@ -14,7 +14,7 @@ import 'yaml_node.dart'; |
| /// A wrapper that makes a normal Dart map behave like a [YamlMap]. |
| class YamlMapWrapper extends MapBase |
| - with pkg_collection.UnmodifiableMapMixin<dynamic, YamlNode> |
| + with pkg_collection.UnmodifiableMapMixin |
| implements YamlMap { |
| final Map _dartMap; |
| @@ -61,7 +61,9 @@ class _YamlMapNodes extends MapBase<dynamic, YamlNode> |
| _YamlMapNodes(this._dartMap, this._span); |
| YamlNode operator [](Object key) { |
| - if (key is YamlScalar) key = key.value; |
| + // Use "as" here because key being assigned to invalidates local type |
| + // inference. |
|
Bob Nystrom
2014/06/24 20:03:49
"local type inference" -> "type propagation"
nweiz
2014/06/24 20:04:45
Done.
|
| + if (key is YamlScalar) key = (key as YamlScalar).value; |
| if (!_dartMap.containsKey(key)) return null; |
| return _nodeForValue(_dartMap[key], _span); |
| } |