Tooltip shows function as available, and shows error that it isn't at the same time
- Vorherrschende Sprache
- F#
- Sterne
- 4.3k
- Forks
- 877
- Ø Merge
- 5 T. 11 Std.
- Gemergte PRs (30 T.)
- 153
Beschreibung
This screenshot illustrates this:

**Repro steps**
You can repro this in various ways when shadowing is involved. I've seen it in large code-bases before but only now found a small repro. I'm not sure it only happens with shadowing, though:
```f#
module X =
type Testing =
| Testing of string
static member create x = Testing x
// shadowing constructor & type
let Testing (_: 'a): 'a = failwith "wrong!"
module Y =
let tryMe =
let y = X.Testing.create "foo"
y
```
**Expected behavior**
The tooltip should not list the member, as it is inaccessible. It should just show the error.
Alternatively, the tooltip can give more info if the member exists, but is inaccessible, but in that case it should do that with some decoration, perhaps. For instance, putting it in brackets or adding the text "inaccessible: " in front of it for clarity. As such, it would add value. As it is now, it causes confusion, letting me believe that the compiler is at odds with itself.
**Actual behavior**
The tooltip lists the member, even though it clearly isn't in scope.
Also: when hitting F12 to "go to member", the cursor moves to the (hidden) member. In complex code bases this can be really confusing, where I think something like "wait, the member is here, I can go to the member, the tooling shows it, but I still get an error, why?".
**Known workarounds**
In complex situations you somehow have to find out why the member is not accessible, which can be daunting.
**Related information**
Seen in any recent F# version in VS2019.
Beitragsleitfaden
Rechercherichtung
Beginne mit der Shadowing-Reproduktion im Issue und verfolge die für den Visual Studio-Tooltip und die F12-Navigation verantwortlichen F#-Language-Service-Pfade. Als abgeschlossen gilt dies, wenn ein nicht zugängliches Member nicht als verfügbar präsentiert oder eindeutig als nicht zugänglich markiert wird und die Navigation nicht irreführend auf dieses verweist.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- fsharp
- Bereich
- developer-experience, tooling
- Issue-Typ
- Bug
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100