@@ -128,16 +128,12 @@ class FieldInfo<T> {
128
128
subBuilder = null ;
129
129
130
130
FieldInfo .repeated (this .name, this .tagNumber, this .index, this .type,
131
- this .check, this .subBuilder,
131
+ CheckFunc < T > this .check, this .subBuilder,
132
132
{this .valueOf, this .enumValues, this .defaultEnumValue, String ? protoName})
133
- : makeDefault = (() => PbList <T >(check: check! )),
134
- _protoName = protoName {
135
- ArgumentError .checkNotNull (name, 'name' );
136
- ArgumentError .checkNotNull (tagNumber, 'tagNumber' );
137
- assert (_isRepeated (type));
138
- assert (check != null );
139
- assert (! _isEnum (type) || valueOf != null );
140
- }
133
+ : makeDefault = (() => PbList <T >(check: check)),
134
+ _protoName = protoName,
135
+ assert (_isRepeated (type)),
136
+ assert (! _isEnum (type) || valueOf != null );
141
137
142
138
static MakeDefaultFunc ? findMakeDefault (int type, dynamic defaultOrMaker) {
143
139
if (defaultOrMaker == null ) return PbFieldType ._defaultForType (type);
@@ -276,13 +272,11 @@ class MapFieldInfo<K, V> extends FieldInfo<PbMap<K, V>?> {
276
272
this .valueCreator,
277
273
{ProtobufEnum ? defaultEnumValue,
278
274
String ? protoName})
279
- : super (name, tagNumber, index, type,
275
+ : assert (_isMapField (type)),
276
+ super (name, tagNumber, index, type,
280
277
defaultOrMaker: () => PbMap <K , V >(keyFieldType, valueFieldType),
281
278
defaultEnumValue: defaultEnumValue,
282
279
protoName: protoName) {
283
- ArgumentError .checkNotNull (name, 'name' );
284
- ArgumentError .checkNotNull (tagNumber, 'tagNumber' );
285
- assert (_isMapField (type));
286
280
assert (! _isEnum (type) || valueOf != null );
287
281
}
288
282
0 commit comments