dotnet / dotnet/fsharp

fluent calls requiring method name to be next to the paren

Open
#15,780 0 comments 1 reaction 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

I stumbled on this using fluent API, it is required for the method name to be next to the paren:

```fsharp
type C() =
member this.M() = this
member this.M2 o = this

let c =
C()
.M()
.M2(1)
.M ()
.M2 (3)
```

> error FS0039: The type 'Unit' does not define the field, constructor or member 'M2'.
> error FS0501: The member or object constructor 'M' takes 0 argument(s) but is here given 1. The required signature is 'member C.M: unit -> C'.

Wondering if this is something to improve on, the error messages are a bit confusing, despite they make sense when considering function application.

related: #1103 & https://github.com/fsharp/fslang-suggestions/issues/999

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.