Query headOrDefault and exactlyOneOrDefault with a struct/tuple
Open
Area-Queries
Bug
Impact-Low
- Dominant language
- F#
- Stars
- 4.3k
- Forks
- 876
- Avg merge
- 4d 11h
- Merged PRs (30d)
- 131
Description
What should the following syntax do:
```fsharp
open System
open System.Linq
let myQueryable = [|(1,1); (2,2)|].AsQueryable()
let a, 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.
Contributor guide
Assessment
This issue has not been assessed yet.