Skip to content

Conversation

@peterfaria-lula
Copy link
Contributor

@peterfaria-lula peterfaria-lula commented Nov 15, 2022

Fixes: #97

When a type implements both IDisposable and IAsyncDisposable,
F# cannot determine which overload of TaskSeqBuilder.Using to use.

@peterfaria-lula
Copy link
Contributor Author

Relates to #97

@abelbraaksma abelbraaksma force-pushed the task-seq-builder-using-bug branch 2 times, most recently from 757f3e7 to 9220c72 Compare November 25, 2022 00:21
@abelbraaksma abelbraaksma added bug Something isn't working topic: taskseq-ce Related to the taskseq computation expression builders or overloads labels Nov 25, 2022
When a type implements both IDisposable and IAsyncDisposable,
F# cannot determine which overload of TaskSeqBuilder.Using to use.
@abelbraaksma abelbraaksma force-pushed the task-seq-builder-using-bug branch from 9220c72 to e5795e9 Compare November 26, 2022 21:45
@abelbraaksma
Copy link
Member

@peterfaria-lula I hope it's ok that I hijacked your branch ;). Working on a solution. Thanks for providing the failing code as an example!

@abelbraaksma
Copy link
Member

abelbraaksma commented Nov 27, 2022

Solution is now as follows:

  • Added MediumPriority (no others needed) with AutoOpen.
  • Removed IPriority1 and IPriority2 marker interfaces, as they aren't needed when splitting overloads over modules.
  • Changed the default namespace for TaskSeqBuilder to be directly under FSharp.Control (this simplifies other auto-opens).
  • Improved the tests such that we are sure the dispose methods are called.
  • Ensure IAsyncDisposable is preferred if IDisposable and IAsyncDisposable are both present. This behavior is protected by a test.

Thanks @peterfaria-lula for writing the repro tests, it made it a breeze to analyze and solve.

This will be available in v0.3.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working topic: taskseq-ce Related to the taskseq computation expression builders or overloads

Projects

None yet

Development

Successfully merging this pull request may close these issues.

F# fails to determine which overload of TaskSeqBuilder.Using to use.

2 participants