Module import is considered unused if it used only for an extension method used in a CE
- Dominant language
- F#
- Stars
- 4.3k
- Forks
- 876
- Avg merge
- 4d 11h
- Merged PRs (30d)
- 131
Description
**Repro steps**
Consider the following code:
```fsharp
open System.Threading.Tasks
module Builder =
type AsyncBuilder with
// allows to bind to the result of Tasks
member _.Bind (task : Task<'a>, cont : 'a -> Async<'b>) =
async.Bind (Async.AwaitTask task, cont)
open Builder
let task = Task.FromResult 1
let x = async {
let! i = task
return i + 1
}
```
Here the `Builder` module contains an extension method for an `AsyncBuilder` that enables the former to bind to the results of usual .Net tasks.
**Expected behavior**
No compiler warnings or errors.
**Actual behavior**
F# compiler considers this import to be not required:
Warning "IDE0005: Open declaration can be removed".

But it is required as without it the compiler generates an error:
```
X.fs(16, 14): [FS0001] This expression was expected to have type
'Async<'a>'
but here has type
'Task'
```
**Related information**
* Operating system — Windows 10
* .NET Framework 4.7.2
* Visual Studio 16.10.0
Contributor guide
Assessment
This issue has not been assessed yet.