dotnet / dotnet/fsharp

No unused value warnings for functions applications containing warnings

Open
#5,767 0 comments 0 reactions 0 assignees View on GitHub
Area-Diagnostics Feature Improvement
Dominant language
F#
Stars
4.3k
Forks
876
Avg merge
4d 22h
Merged PRs (30d)
144

Description

When there're warnings produced for function applications there're no warnings about unused values for these applications.
```fsharp
open System

[]
let foo a b = a + b + 1

let bar a b = a + b + 1

let baz x = x + 1

for x in [] do foo x
for x in [] do 123

foo 1
bar 1
baz 1
```

```
Program.fs(10, 16): [FS0044] This construct is deprecated. yo
Program.fs(10, 16): [FS0193] This expression is a function value, i.e. is missing arguments. Its type is ^a -> int.

Program.fs(11, 16): [FS0020] The result of this expression is implicitly ignored. Consider using 'ignore' to discard this value explicitly, e.g. 'expr |> ignore', or 'let' to bind the result to a name, e.g. 'let result = expr'.

Program.fs(13, 1): [FS0044] This construct is deprecated. yo
Program.fs(13, 1): [FS0193] This expression is a function value, i.e. is missing arguments. Its type is ^a -> int.

Program.fs(14, 1): [FS0193] This expression is a function value, i.e. is missing arguments. Its type is ^a -> int.

Program.fs(15, 1): [FS0020] The result of this expression is implicitly ignored. Consider using 'ignore' to discard this value explicitly, e.g. 'expr |> ignore', or 'let' to bind the result to a name, e.g. 'let result = expr'.
```

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.