dotnet / fsharp

The F# compiler, F# core library, F# language service, and F# tooling integration for Visual Studio
https://dotnet.microsoft.com/languages/fsharp
MIT License
3.94k stars 788 forks source link

hidden variable names leak into normal namespace #3705

Open tldrlol opened 7 years ago

tldrlol commented 7 years ago
let add _ _ = _arg1 + _arg2

[<EntryPoint>]
let main _ =
  printfn "%d" (add 1 2)
  0

The above snippet compiles, runs and works (as expected). I imagine this is an oversight, buggy behavior that was not intended to happen. Specifically, being able to alias the arguments denoted by the ignore pattern with _arg[n] syntax.

On the plus side, tooling (vanilla VS2017) does not offer Intellisense or anything of the sort in this situation.

tldrlol commented 7 years ago

Apologies, I should clarify.

While they do not appear in the completion lists, hovering over them reveals type information as normal.

Krzysztof-Cieslak commented 7 years ago

I can report same in VSCode - no intellisense, tooltips are working, finding usages is working

image

image

tldrlol commented 7 years ago

I had to calm down before posting this, because this was too funny also: 😄

I spoke too soon.

tooling-help