Issue description
Reference type DU can be optimized into a single root class with fields.
Either when it is a single-case DU.
Or when it uses null as true value for the nullary cases.
In both scenarios, C# consumers do not see field nullability in the generated constructor.
Choose one or more from the following categories of impact
Operating System
Windows (Default)
What .NET runtime/SDK kind are you seeing the issue on
.NET SDK (.NET Core, .NET 5+)
.NET Runtime/SDK version
No response
Reproducible code snippet and actual behavior
[<NoComparison;NoEquality>]
type SingleCaseDu = SingleCaseItIs of nullableString:(string|null)
[<CompilationRepresentation(CompilationRepresentationFlags.UseNullAsTrueValue)>]
[<NoEquality; NoComparison>]
type NonGenericNullAsTrueValue =
| MyNone
| MySome of nullableString:(string|null)
Possible workarounds
No response
Issue description
Reference type DU can be optimized into a single root class with fields.
Either when it is a single-case DU.
Or when it uses null as true value for the nullary cases.
In both scenarios, C# consumers do not see field nullability in the generated constructor.
Choose one or more from the following categories of impact
nullconstructs in code not using the checknulls switch.null,not null).Operating System
Windows (Default)
What .NET runtime/SDK kind are you seeing the issue on
.NET SDK (.NET Core, .NET 5+)
.NET Runtime/SDK version
No response
Reproducible code snippet and actual behavior
Possible workarounds
No response