dotnet / dotnet/fsharp

Inconsistent 'missing `new`' warnings

Open
#16,468 5 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

Consider this sample:
```fsharp
open System

type AsyncDisposable() =
interface IAsyncDisposable with
member this.DisposeAsync() = failwith "todo"

type Disposable() =
interface IDisposable with
member this.Dispose() = failwith "todo"

AsyncDisposable() |> ignore
Disposable() |> ignore
```

There's an inconsistency in how different kinds of disposables are checked in terms of requiring `new` keyword. I think we both interfaces should probably be treated equally:

Screenshot 2023-12-25 at 11 57 20

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.