Skip to content

Improve Error Reporting: Incorrect error message on 'if' expression #1450

@isaacabraham

Description

@isaacabraham

Related to #1102. The following code snippet leads to a misleading error message:

type Person = { Name : string; }

let x =
    if 5 > 10 then { Name = "Isaac" }

The error is: error FS1129: The type 'unit' does not contain a field 'Name'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions