Skip to content

Nullness - box function from FSharp.Core should return nullable type if argument if nullable and non-nullable type with argument is non-nullable. #17730

@Lanayx

Description

@Lanayx

Repro steps

let y = box 1

Expected behavior

y should be of type obj

Actual behavior

y has type obj | null

Known workarounds

let y = 
    match box 1 with
    | NonNull i -> i
    | Null -> failwith "never fails"

Related information

Provide any related information (optional):

  • Windows 11
  • dotnet 9.0.0-rc.1.24431.7

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Done

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions