-
Notifications
You must be signed in to change notification settings - Fork 832
Labels
Area-Compiler-CheckingType checking, attributes and all aspects of logic checkingType checking, attributes and all aspects of logic checkingBugImpact-Medium(Internal MS Team use only) Describes an issue with moderate impact on existing code.(Internal MS Team use only) Describes an issue with moderate impact on existing code.
Milestone
Description
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
BoundedChenn31 and auduchinok
Metadata
Metadata
Assignees
Labels
Area-Compiler-CheckingType checking, attributes and all aspects of logic checkingType checking, attributes and all aspects of logic checkingBugImpact-Medium(Internal MS Team use only) Describes an issue with moderate impact on existing code.(Internal MS Team use only) Describes an issue with moderate impact on existing code.
Type
Projects
Status
New