You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Nullness - box function from FSharp.Core should return nullable type if argument if nullable and non-nullable type with argument is non-nullable. #17730
changed the title [-]Nullness - string and box functions from FSharp.Core should return nullable type if argument if nullable and non-nullable type with argument is non-nullable.[/-][+]Nullness - box function from FSharp.Core should return nullable type if argument if nullable and non-nullable type with argument is non-nullable.[/+]on Sep 14, 2024
Closing per comments, please raise language suggestion for the libraries/language. Currently we can't change non-generic return type of the function based on value.
Activity
brianrourkeboll commentedon Sep 14, 2024
string nullreturns"", notnull, though.Lanayx commentedon Sep 14, 2024
@brianrourkeboll oh, thanks, didn't realize that! Updating the issue
[-]Nullness - string and box functions from FSharp.Core should return nullable type if argument if nullable and non-nullable type with argument is non-nullable.[/-][+]Nullness - box function from FSharp.Core should return nullable type if argument if nullable and non-nullable type with argument is non-nullable.[/+]kerams commentedon Sep 14, 2024
boxis not constrained to value types, soobj | nullis correct too.Lanayx commentedon Sep 14, 2024
@kerams it's is correct with current implementation, but it's not a desired solution, that's why I converted it from bug to feature request :)
kerams commentedon Sep 14, 2024
It is desired -
boxcan returnnull:Here's what you want:
vzarytovskii commentedon Sep 14, 2024
Closing per comments, please raise language suggestion for the libraries/language. Currently we can't change non-generic return type of the function based on value.
Lanayx commentedon Sep 15, 2024
@brianrourkeboll I've just figured out that
stringcan return null, so probably type should be changed (or implementation):