RequiresExplicitTypeArguments always results in warnings when applied to functions with no explicit type arguments
- Dominant language
- F#
- Stars
- 4.3k
- Forks
- 876
- Avg merge
- 4d 11h
- Merged PRs (30d)
- 131
Description
Consider the following F# code:
```fsharp
[]
let f x = x
f 12 |> ignore
```
This gives an error:
```
The generic function 'f' must be given explicit type argument(s)
```
So I can give it a type argument, like `int` or `_`:
```fsharp
[]
let f x = x
f 12 |> ignore
f<_> "hello" |> ignore
```
But I get a new warning:
```
The method or function 'f' should not be given explicit type argument(s) because it does not
declare its type parameters explicitly
```
Giving it a type argument satisfies that warning (but I can't do the last line anymore since it's now been specialized to `int`).
I think it should instead give a warning on the attribute application if there isn't an explicit type parameters.
Contributor guide
Assessment
This issue has not been assessed yet.