Skip to content

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

Open
@bryanedds

Description

@bryanedds

Repro. case in F# 4.4.0.0 -

[<CompilationRepresentation (CompilationRepresentationFlags.UseNullAsTrueValue)>]
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.

[<CompilationRepresentation (CompilationRepresentationFlags.UseNullAsTrueValue)>]
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 - fsharp/fsharp#510

Cheers!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-Compiler-CheckingType checking, attributes and all aspects of logic checkingBugImpact-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