Fix illogical caution: Dispose should say DisposeAsync#45588
Fix illogical caution: Dispose should say DisposeAsync#45588jzabroski wants to merge 1 commit intodotnet:mainfrom
Conversation
BillWagner
left a comment
There was a problem hiding this comment.
I'll comment and leave the final wording to @gewarren
I agree that we should change this cautionary warning. However, this fix is misleading. The purpose of the warning is that a type that implements IAsyncDisposable but not IDisposable can't be used and disposed synchronously. If a consumer chooses to use the synchronous APIs, there won't be a Dispose method. Therefore, consumers using the synchronous APIs are likely to leak resources.
|
I see. I think your point is that
There may be other patterns. Not enough coffee yet in the morning. |
|
Hi @jzabroski The use case for both If you only provide |
|
I'm going to close this since the original wording is correct. |
Summary
The warning says:
The warning is illogical. If you do not implement IDisposable, there is no Dispose method to call. IAsyncDisposable only supports DisposeAsync.
Internal previews