Skip to content

Query headOrDefault and exactlyOneOrDefault with a struct/tuple #3845

Description

@Thorium

What should the following syntax do:

openSystemopenSystem.LinqletmyQueryable=[|(1,1);(2,2)|].AsQueryable()leta,b =
query {for x in myQueryable do
where(x =(3,3))
headOrDefault
}

Currently it compiles, but produces a runtime System.NullReferenceException. A thing that we shouldn't have in FSharp, right?

Edit: The reason is...well, read the replies.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-QueriesQuery expressions and library implementationBugImpact-Low(Internal MS Team use only) Describes an issue with limited impact on existing code.

    Type

    Projects

    Status
    In Progress

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions