Open AlexeyRaga opened 8 months ago
Hi,
I believe it should be an error. The way we are dealing with records needs some improvement.
I would recommend until the fix use normal structs, if you are on a newer C# it is possible to define more succint than even records readonly partial struct ProductId;
This scenario is allowed and the compiler doesn't fail:
However it generates an extra
Value
field that shadows the one that is provided in the constructor:As a result, values that are created with the constructor are "missing" the provided inner value: