Skip to content

Commit

Permalink
Merge branch '7-implicitnullable-fails-during-serialization' into 'ma…
Browse files Browse the repository at this point in the history
…ster'

Resolve "ImplicitNullable fails during serialization."

Closes #7

See merge request marta/kaitai_struct_csharp_runtime!16
  • Loading branch information
pluskal committed Jul 13, 2020
2 parents a738aff + 5c1be97 commit 029d318
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Kaitai.Struct.Runtime/ImplicitNullable.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Text;

Expand All @@ -7,7 +7,7 @@ namespace Kaitai
public struct ImplicitNullable<T> where T : struct
{
public bool HasValue { get { return this._value.HasValue; } }
public T Value { get { return this._value.Value; } }
public T Value { get { return this._value ?? default; } }

public ImplicitNullable(T value) : this() { this._value = value; }
public ImplicitNullable(T? value) : this() { this._value = value; }
Expand Down

0 comments on commit 029d318

Please sign in to comment.