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

Unified Diff: test/enum_generator_test.dart

Issue 1829573002: Fix all strong mode warnings in protoc-plugin (Closed) Base URL: git@github.com:dart-lang/dart-protoc-plugin.git@master
Patch Set: regenerate pb.dart files Created 4 years, 9 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 | « test/bazel_test.dart ('k') | test/file_generator_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/enum_generator_test.dart
diff --git a/test/enum_generator_test.dart b/test/enum_generator_test.dart
index 226b9e58e3afca39c33d4cc499a0cd81fb265333..6903d376d7270923533c045727743dbded4dc9fe 100755
--- a/test/enum_generator_test.dart
+++ b/test/enum_generator_test.dart
@@ -26,8 +26,8 @@ class PhoneType extends ProtobufEnum {
WORK,
];
- static final Map<int, PhoneType> _byValue = ProtobufEnum.initByValue(values);
- static PhoneType valueOf(int value) => _byValue[value];
+ static final Map<int, dynamic> _byValue = ProtobufEnum.initByValue(values);
+ static PhoneType valueOf(int value) => _byValue[value] as PhoneType;
static void $checkItem(PhoneType v) {
if (v is !PhoneType) checkItemFailed(v, 'PhoneType');
}
@@ -37,20 +37,21 @@ class PhoneType extends ProtobufEnum {
''';
EnumDescriptorProto ed = new EnumDescriptorProto()
- ..name = 'PhoneType'
- ..value.addAll([
- new EnumValueDescriptorProto()
- ..name = 'MOBILE'
- ..number = 0,
- new EnumValueDescriptorProto()
- ..name = 'HOME'
- ..number = 1,
- new EnumValueDescriptorProto()
- ..name = 'WORK'
- ..number = 2,
- new EnumValueDescriptorProto()
- ..name = 'BUSINESS'
- ..number = 2]);
+ ..name = 'PhoneType'
+ ..value.addAll([
+ new EnumValueDescriptorProto()
+ ..name = 'MOBILE'
+ ..number = 0,
+ new EnumValueDescriptorProto()
+ ..name = 'HOME'
+ ..number = 1,
+ new EnumValueDescriptorProto()
+ ..name = 'WORK'
+ ..number = 2,
+ new EnumValueDescriptorProto()
+ ..name = 'BUSINESS'
+ ..number = 2
+ ]);
IndentingWriter writer = new IndentingWriter();
EnumGenerator eg = new EnumGenerator(ed, null);
eg.generate(writer);
« no previous file with comments | « test/bazel_test.dart ('k') | test/file_generator_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698