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

Unified Diff: lib/src/protobuf/mixins/map_mixin.dart

Issue 2019423002: Make PbMapMixin implement Map<String, dynamic> (Closed) Base URL: https://github.com/dart-lang/dart-protobuf.git@master
Patch Set: nits 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 | « CHANGELOG.md ('k') | pubspec.yaml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/protobuf/mixins/map_mixin.dart
diff --git a/lib/src/protobuf/mixins/map_mixin.dart b/lib/src/protobuf/mixins/map_mixin.dart
index 0032552f3796c0245f2444230a0bee07a9b9762d..0928681b87bf43dab953bf1e29c5b5b1b6aacd2b 100644
--- a/lib/src/protobuf/mixins/map_mixin.dart
+++ b/lib/src/protobuf/mixins/map_mixin.dart
@@ -11,7 +11,7 @@ import "package:protobuf/protobuf.dart" show BuilderInfo;
///
/// This mixin is enabled via an option in
/// dart_options.proto in dart-protoc-plugin.
-abstract class PbMapMixin implements Map {
+abstract class PbMapMixin implements Map<String, dynamic> {
// GeneratedMessage properties and methods used by this mixin.
BuilderInfo get info_;
@@ -29,8 +29,8 @@ abstract class PbMapMixin implements Map {
}
@override
- operator []=(key, val) {
- var tag = getTagNumber(key as String);
+ void operator []=(String key, val) {
+ var tag = getTagNumber(key);
if (tag == null) {
throw new ArgumentError(
"field '${key}' not found in ${info_.messageName}");
@@ -39,13 +39,13 @@ abstract class PbMapMixin implements Map {
}
@override
- get keys => info_.byName.keys;
+ Iterable<String> get keys => info_.byName.keys;
@override
bool containsKey(Object key) => info_.byName.containsKey(key);
@override
- get length => info_.byName.length;
+ int get length => info_.byName.length;
@override
remove(key) {
« no previous file with comments | « CHANGELOG.md ('k') | pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698