-
Notifications
You must be signed in to change notification settings - Fork 470
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Disposable analyzers are not CompositeDisposable aware #3477
Comments
@mavasani If we don't want to have a built-in "exception" for such case, would it be possible to at least create some kind of option where we could define a list of method doing some ownership transfer? |
I think it would be handy to have something a little more fine-grained that Analyzer Configuration.md#configure-dispose-ownership-transfer-for-disposable-objects-passed-as-arguments-to-method-calls and instead have a list of methods/types/namespaces that are considered as transferring ownership. @mavasani WDYT? |
I think we need to go with attribute annotation based solution here, similar to nullable attributes. editorconfig option might provide an alternate, but attributes are much more descriptive in source. @Evangelink would you like to come up with a proposal about set of attributes that we can use here? |
I think we could have a look at this proposal: dotnet/runtime#29631 |
There is an inconsistency between CA2000 and CA2213. CA2000 recognizes "Collection Add methods" as ownership transfer. CA2213 does not or do I need to say not anymore. |
Analyzer package
Microsoft.CodeAnalysis.FxCopAnalyzers
Package Version
v3.0.0-beta3.final (latest pre-release)
Diagnostic ID
Example: CA2213
But I assume some other analyzers might be wrong too.
Repro steps
The text was updated successfully, but these errors were encountered: