Skip to content

Commit dc6e8fb

Browse files
committed
Fix warnings
1 parent edfe97a commit dc6e8fb

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

protobuf/lib/src/protobuf/field_info.dart

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -131,11 +131,10 @@ class FieldInfo<T> {
131131
this.check, this.subBuilder,
132132
{this.valueOf, this.enumValues, this.defaultEnumValue, String? protoName})
133133
: makeDefault = (() => PbList<T>(check: check!)),
134-
_protoName = protoName {
135-
assert(_isRepeated(type));
136-
assert(check != null);
137-
assert(!_isEnum(type) || valueOf != null);
138-
}
134+
_protoName = protoName,
135+
assert(_isRepeated(type)),
136+
assert(check != null),
137+
assert(!_isEnum(type) || valueOf != null);
139138

140139
static MakeDefaultFunc? findMakeDefault(int type, dynamic defaultOrMaker) {
141140
if (defaultOrMaker == null) return PbFieldType._defaultForType(type);
@@ -274,11 +273,11 @@ class MapFieldInfo<K, V> extends FieldInfo<PbMap<K, V>?> {
274273
this.valueCreator,
275274
{ProtobufEnum? defaultEnumValue,
276275
String? protoName})
277-
: super(name, tagNumber, index, type,
276+
: assert(_isMapField(type)),
277+
super(name, tagNumber, index, type,
278278
defaultOrMaker: () => PbMap<K, V>(keyFieldType, valueFieldType),
279279
defaultEnumValue: defaultEnumValue,
280280
protoName: protoName) {
281-
assert(_isMapField(type));
282281
assert(!_isEnum(type) || valueOf != null);
283282
}
284283

0 commit comments

Comments
 (0)