Tooltip shows function as available, and shows error that it isn't at the same time
- Dominant language
- F#
- Stars
- 4.3k
- Forks
- 876
- Avg merge
- 4d 11h
- Merged PRs (30d)
- 131
Description
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.
Contributor guide
Assessment
This issue has not been assessed yet.