dotnet / dotnet/fsharp

Improve error reporting: report visibility issue between two assemblies

Open
#1,348 2 comments 0 reactions 0 assignees View on GitHub
Feature Improvement Theme-Simple-F#
Dominant language
F#
Stars
4.3k
Forks
876
Avg merge
4d 11h
Merged PRs (30d)
131

Description

#### What

Declare private or internal member in project A

``` fsharp
namespace Foo

[]
module internal Utils =
let normalizeArgName () = ()
```

Try to use private or internal member in project B

``` fsharp
open Foo

module Bar =
let foo = normalizeArgName ()
```
#### Why

It might be worth considering reporting visibility issue when private or internal members of referenced assemblies are used (sometimes due to faulty InternalsVisible assembly declaration)
#### How

> The value 'Foo.Utils.normalizeArgName' is not accessible from this code location

(this is same as _error FS1094_, but with qualified name)

Note that if I put the qualified name in usage spot:

``` fsharp
open Foo

module Bar =
let foo = Foo.Utils.normalizeArgName ()
```

I get expected error message.

Related #1103

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.