Closed
Description
Describe the bug
StackOverflawException when getting value from default constructed value object. See reproduction sample below.
To Reproduce
Steps to reproduce the behavior (just an example):
- Add nuget UnitsNet 4.142.0 or later to a .NET 6 project
- Build using Visual Studio 2022 Community v17.3.0
[Fact]
public void Init_DefaultConstruct()
{
Length x = default;
Assert.Equal(0.0, x.Micrometers); // StackOverflowExeption when accessing X.Micrometers property.
}
Expected behavior
A value object should not cause a StackOverflowExeption for default value and it should give 0 as was previous version.