Skip to content

Conversation

@parhamsaremi
Copy link
Contributor

Fixes #517

NOTE: this PR supersedes an older PR

@parhamsaremi parhamsaremi changed the title Add new rule C#-FriendlyAsyncOverload Draft: Add new rule C#-FriendlyAsyncOverload Nov 21, 2022
@parhamsaremi parhamsaremi changed the title Draft: Add new rule C#-FriendlyAsyncOverload DRAFT: Add new rule C#-FriendlyAsyncOverload Nov 21, 2022
@knocte
Copy link
Collaborator

knocte commented Apr 16, 2023

This PR needs to change because we're going to change the convention: instead of having Foo(): Async<'T> for the F# method and FooAsync(): Task<'T> for the C# one, we're gonna have AsyncFoo(): Async<'T>, FooAsync(): Task<'T>, and Foo(): 'T for the synchronous version. This conclusion comes from a debate between me and Afshin in this PR: nblockchain/NOnion#56

@parhamsaremi parhamsaremi force-pushed the fix-CSharpFriendlyAsyncOverloads-conflicts branch 3 times, most recently from 0a6261e to 70d721f Compare May 4, 2023 08:22
@Thorium
Copy link
Member

Thorium commented Nov 18, 2023

Not all the libraries are meant for C# use. For example type-providers, they just don't work in C#.

@knocte
Copy link
Collaborator

knocte commented Dec 29, 2023

Not all the libraries are meant for C# use. For example type-providers, they just don't work in C#.

Good point, that's why this rule won't be enabled by default.

knocte added a commit to knocte/FSharpLint that referenced this pull request Nov 11, 2025
Suffix "Async" for methods is for methods that return
"Task<Foo>", not "Async<Foo".

For more info, see the PR for an upcoming FSharpLint
rule:
fsprojects#586
knocte added a commit to Thorium/FSharpLint that referenced this pull request Nov 11, 2025
Suffix "Async" for methods is for methods that return
"Task<Foo>", not "Async<Foo".

For more info, see the PR for an upcoming FSharpLint
rule:
fsprojects#586
knocte added a commit to Thorium/FSharpLint that referenced this pull request Nov 14, 2025
Suffix "Async" for methods is for methods that return
"Task<Foo>", not "Async<Foo".

For more info, see the PR for an upcoming FSharpLint
rule:
fsprojects#586
webwarrior-ws pushed a commit to webwarrior-ws/FSharpLint that referenced this pull request Nov 17, 2025
Suffix "Async" for methods is for methods that return
"Task<Foo>", not "Async<Foo".

For more info, see the PR for an upcoming FSharpLint
rule:
fsprojects#586
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Best practice around naming asynchronous methods/functions

4 participants