@@ -128,16 +128,12 @@ class FieldInfo<T> {
128128 subBuilder = null ;
129129
130130 FieldInfo .repeated (this .name, this .tagNumber, this .index, this .type,
131- this .check, this .subBuilder,
131+ CheckFunc < T > this .check, this .subBuilder,
132132 {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 );
141137
142138 static MakeDefaultFunc ? findMakeDefault (int type, dynamic defaultOrMaker) {
143139 if (defaultOrMaker == null ) return PbFieldType ._defaultForType (type);
@@ -276,13 +272,11 @@ class MapFieldInfo<K, V> extends FieldInfo<PbMap<K, V>?> {
276272 this .valueCreator,
277273 {ProtobufEnum ? defaultEnumValue,
278274 String ? protoName})
279- : super (name, tagNumber, index, type,
275+ : assert (_isMapField (type)),
276+ super (name, tagNumber, index, type,
280277 defaultOrMaker: () => PbMap <K , V >(keyFieldType, valueFieldType),
281278 defaultEnumValue: defaultEnumValue,
282279 protoName: protoName) {
283- ArgumentError .checkNotNull (name, 'name' );
284- ArgumentError .checkNotNull (tagNumber, 'tagNumber' );
285- assert (_isMapField (type));
286280 assert (! _isEnum (type) || valueOf != null );
287281 }
288282
0 commit comments