dotnet / dotnet/fsharp

hidden variable names leak into normal namespace

Open
#3,705 3 comments 0 reactions 0 assignees View on GitHub
Area-Compiler-PatternMatching Bug Impact-Medium
Dominant language
F#
Stars
4.3k
Forks
876
Avg merge
4d 11h
Merged PRs (30d)
131

Description

```fsharp
let add _ _ = _arg1 + _arg2

[]
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.

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.