Issue description
type R = { x: int }
type RA = {| x: int |}
[<EntryPoint>]
let main _args =
let a = System.Text.Json.JsonSerializer.Deserialize<{| x: int |}> "null"
let _a = a.x
let b = System.Text.Json.JsonSerializer.Deserialize<RA> "null"
let _b = b.x
let c = System.Text.Json.JsonSerializer.Deserialize<R> "null"
let _c = c.x
0
The return type of Deserialize is 'T | null, but a warning is only raised for the nominal record on c.x, yet a.x and b.x will throw too.
Additionally, there's a discrepancy in tooltips - a is val a: {| a: int |}, but on b, where the type is aliased, it is val b: RA | null.
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
9.0.100-rc.2.24474.11
Reproducible code snippet and actual behavior
No response
Possible workarounds
No response
Issue description
The return type of
Deserializeis'T | null, but a warning is only raised for the nominal record onc.x, yeta.xandb.xwill throw too.Additionally, there's a discrepancy in tooltips -
aisval a: {| a: int |}, but onb, where the type is aliased, it isval b: RA | null.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
9.0.100-rc.2.24474.11
Reproducible code snippet and actual behavior
No response
Possible workarounds
No response