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

Unified Diff: pkg/compiler/lib/src/serialization/serialization.dart

Issue 2852053003: Fix typing in dart2js serialization. (Closed)
Patch Set: Created 3 years, 8 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/serialization/serialization.dart
diff --git a/pkg/compiler/lib/src/serialization/serialization.dart b/pkg/compiler/lib/src/serialization/serialization.dart
index 07c1ff10a19ead67d7a6b6b073ea2b189ee788dc..9fe99f9d8428dd438d14d151bd250886f1fef119 100644
--- a/pkg/compiler/lib/src/serialization/serialization.dart
+++ b/pkg/compiler/lib/src/serialization/serialization.dart
@@ -262,7 +262,7 @@ abstract class AbstractEncoder<K> {
/// [ObjectDecoder] reads serialized values from a [Map] encoded from an
/// [ObjectValue] where properties are stored using [Key] values as keys.
-class ObjectDecoder extends AbstractDecoder<Key> {
+class ObjectDecoder extends AbstractDecoder<dynamic, Key> {
/// Creates an [ObjectDecoder] that decodes [map] into deserialized values
/// using [deserializer] to create canonicalized values.
ObjectDecoder(Deserializer deserializer, Map map) : super(deserializer, map);
@@ -273,14 +273,14 @@ class ObjectDecoder extends AbstractDecoder<Key> {
/// [MapDecoder] reads serialized values from a [Map] encoded from an
/// [MapValue] where entries are stored using [String] values as keys.
-class MapDecoder extends AbstractDecoder<String> {
+class MapDecoder extends AbstractDecoder<String, String> {
/// Creates an [MapDecoder] that decodes [map] into deserialized values
/// using [deserializer] to create canonicalized values.
MapDecoder(Deserializer deserializer, Map<String, dynamic> map)
: super(deserializer, map);
@override
- _getKeyValue(String key) => key;
+ String _getKeyValue(String key) => key;
/// Applies [f] to every key in the decoded [Map].
void forEachKey(f(String key)) {
@@ -313,9 +313,9 @@ class ListDecoder {
}
/// Abstract base implementation for [ObjectDecoder] and [MapDecoder].
-abstract class AbstractDecoder<K> {
+abstract class AbstractDecoder<M, K> {
final Deserializer _deserializer;
- final Map<K, dynamic> _map;
+ final Map<M, dynamic> _map;
AbstractDecoder(this._deserializer, this._map) {
assert(_deserializer != null);
@@ -324,7 +324,7 @@ abstract class AbstractDecoder<K> {
/// Returns the value for [key] defined by the [SerializationDecoder] in used
/// [_deserializer].
- _getKeyValue(K key);
+ M _getKeyValue(K key);
/// Returns `true` if [key] has an associated value in the decoded object.
bool containsKey(K key) => _map.containsKey(_getKeyValue(key));
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698