Skip to content

Commit 90759f9

Browse files
committed
Fix CreateInstance method to avoid compiler warning in generated code.
1 parent c6b5fe2 commit 90759f9

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

src/MsgPack/Serialization/AbstractSerializers/SerializerBuilder`3.Collection.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -287,16 +287,21 @@ private void BuildCollectionCreateInstance( TContext context, Type concreteType,
287287
context,
288288
typeof( TObject ),
289289
collection,
290-
this.EmitRetrunStatement(
290+
this.EmitStoreVariableStatement(
291291
context,
292+
collection,
292293
this.EmitCreateNewObjectExpression(
293294
context,
294295
collection,
295296
ctor,
296-
ctor.GetParameters().Length == 0
297+
ctor.GetParameters().Length == 0
297298
? NoConstructs
298299
: new[] { context.InitialCapacity }
299300
)
301+
),
302+
this.EmitRetrunStatement(
303+
context,
304+
this.EmitLoadVariableExpression( context, collection )
300305
)
301306
);
302307
}

0 commit comments

Comments
 (0)