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

Unified Diff: pkg/yaml/lib/src/yaml_node_wrapper.dart

Issue 354653003: Fix busted type parameters in yaml. Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: changelog entry Created 6 years, 6 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 | « pkg/yaml/CHANGELOG.md ('k') | pkg/yaml/pubspec.yaml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
« no previous file with comments | « pkg/yaml/CHANGELOG.md ('k') | pkg/yaml/pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698