dotnet / dotnet/fsharp

Unions with 4 or more cases silently fail to utilize UseNullAsTrueValue.

Open
#711 13 comments 0 reactions 0 assignees View on GitHub
Area-Compiler-Checking Bug Impact-Low
Dominant language
F#
Stars
4.3k
Forks
876
Avg merge
4d 11h
Merged PRs (30d)
131

Description

Repro. case in F# 4.4.0.0 -

```
[]
type T = A | B of int | C of int | D of int;;
A;;
```

In F# interactive, here you'll see that A is a proper value, which is not desired.

```
[]
type T = A | B of int | C of int;;
A;;
```

In F# interactive, here you'll see that A is a null, which is desired.

Would be a nice optimization to have this work for 4 cases as here - https://github.com/bryanedds/Prime/blob/master/Prime/Prime/Prime/Vmap.fs#L25-L30

NOTE: Issue moved from here - https://github.com/fsharp/fsharp/issues/510

Cheers!

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.