New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tooltip shows wrong name resolution on uncallable static member due to name collision #8875
Comments
Simpler reproduction: module Dom =
type WindowDelimiter =
static member FromCs = ()
type Tree =
| WindowDelimiter
let a = Dom.WindowDelimiter.FromCs |
This feels like a bug on two fronts:
@charlesroddie Yours looks slightly different. Since |
Doesn't the fact that my code give the same behaviour show that its the same issue? It eliminates various things that could be causing the issue (multiple potential conflicts in the use of the name I'm happy to agree with you that my reduction shouldn't compile for this reason, and that the fix should be to adjust intellisense rather than compilation. But that should apply equally to the code in the OP. |
This is currently by design, and an RFC will be needed to change things, so I'm tracking this with this language suggestion fsharp/fslang-suggestions#907 Essentially in The type should be used to qualify the name in these cases, with or without RequireQUalifiedAccess The fact that the IDE is showing the other resolution is a bug |
Expected behavior
The last line should be OK, even the tooling shows the method in auto-complete, the signature is on the type tooltip, and the member definition highlights when the carret is on the invocation.
Actual behavior
Known workarounds
@gusty pointed that SRTP trait call enables calling the member.
Another work around involve putting
RequireQualifiedAccess
which is not always possible / wanted.Related information
Visual Studio 16.5.2
#6805 (comment) => a case where SRTP is useful to work around a compiler limitation.
The text was updated successfully, but these errors were encountered: