Fixed struct initialization error on older versions of C#

"'this' object cannot be used before all of its fields are assigned to"

Change-Id: Icccdcc0d0be0fe0b87abe0eb28fe1cc91116fcfb
This commit is contained in:
Wouter van Oortmerssen
2019-12-23 17:35:54 -08:00
parent 9b13201356
commit 3a70e0b308
2 changed files with 2 additions and 2 deletions

View File

@@ -25,7 +25,7 @@ namespace FlatBuffers
public ByteBuffer bb { get; private set; }
// Re-init the internal state with an external buffer {@code ByteBuffer} and an offset within.
public Struct(int _i, ByteBuffer _bb)
public Struct(int _i, ByteBuffer _bb) : this()
{
bb = _bb;
bb_pos = _i;

View File

@@ -31,7 +31,7 @@ namespace FlatBuffers
public ByteBuffer ByteBuffer { get { return bb; } }
// Re-init the internal state with an external buffer {@code ByteBuffer} and an offset within.
public Table(int _i, ByteBuffer _bb)
public Table(int _i, ByteBuffer _bb) : this()
{
bb = _bb;
bb_pos = _i;