dotnet / dotnet/fsharp

Visual F# Tools shows Option.toNullable is from another projects internal module

Open
#14,678 1 comment 0 reactions 0 assignees View on GitHub
Bug Impact-Low Needs-Repro
Dominant language
F#
Stars
4.3k
Forks
876
Avg merge
4d 11h
Merged PRs (30d)
131

Description

_This issue has been moved from [a ticket on Developer Community](https://developercommunity.visualstudio.com/t/Visual-F-Tools-shows-OptiontoNullable-/10259735)._

---
Visual F# tools claims that `Option.toNullable` and `Option.toNullable` from other projects is from an internal module of a dependent project.

[]
module internal YoLo

module Option =

let ofNullable nullable : 'a option =
match box nullable with
| null -> None // CLR null
| :? Nullable as n when not n.HasValue -> None // CLR struct
| :? Nullable as n when n.HasValue -> Some(n.Value) // CLR struct
| x when x.Equals(DBNull.Value) -> None // useful when reading from the db into F#
| x -> Some(unbox x) // anything else

let toNullable =
function
| Some item -> new Nullable(item)
| None -> new Nullable()

---
### Original Comments

#### Feedback Bot on 1/24/2023, 08:39 AM:

(private comment, text removed)
#### Cameron Taggart [MSFT] on 1/24/2023, 03:56 PM:

(private comment, text removed)

---
### Original Solutions
(no solutions)

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.