Repro steps
type SubSubTest = {
Z: int
}
type SubTest = {
Y: SubSubTest
}
type Test = {
X: SubTest
}
let getTest () =
Unchecked.defaultof<Test>
[<EntryPoint>]
let main argv =
{
getTest () with
X.Y.Z = 123
} |> ignore
0
Expected behavior
Code compiles just fine
Actual behavior
0>Program.fs(21,13): Error FS0039 : The type 'SubTest' does not define the field, constructor or member 'X'.
Known workarounds
Move getTest () to a variable
let t = getTest ()
{
t with
X.Y.Z = 123
} |> ignore
Related information
Reproduces with .NET 8, .NET 9, .NET 10 sdks
Repro steps
Expected behavior
Code compiles just fine
Actual behavior
Known workarounds
Move
getTest ()to a variableRelated information
Reproduces with .NET 8, .NET 9, .NET 10 sdks