★ wanayoo — archive 1999 https://github.com/code-cracker/code-cracker/issues/877Nouvelle recherche | Portail wanayoo
Skip to content
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

BUG: CC0022 DisposableVariableNotDisposedAnalyzer: False positive in iterator methods #877

Closed
oysteinkrog opened this issue Feb 22, 2017 · 2 comments
Assignees
Milestone

Comments

@oysteinkrog
Copy link

@oysteinkrog oysteinkrog commented Feb 22, 2017

#Bug

This should not trigger CC0022:

public IEnumerable<IDisposable> Foo()
{
    var disposable = new MemoryStream();
    yield return disposable;
}

This works:

public IDisposable Foo()
{
    var disposable = new MemoryStream();
    return disposable;
}
@carloscds
Copy link
Contributor

@carloscds carloscds commented Feb 22, 2017

@oysteinkrog Bug confirmed!

@carloscds carloscds added the bug label Feb 22, 2017
@giggio giggio modified the milestones: 1.0.2, 1.0.3 Mar 11, 2017
@giggio giggio changed the title CC0022 DisposableVariableNotDisposedAnalyzer: False positive in iterator methods BUG: CC0022 DisposableVariableNotDisposedAnalyzer: False positive in iterator methods Mar 13, 2017
@giggio giggio self-assigned this Mar 18, 2017
giggio added a commit to giggio/code-cracker that referenced this issue Mar 19, 2017
@giggio giggio added 3 - Done and removed 2 - Working labels Mar 20, 2017
@giggio
Copy link
Member

@giggio giggio commented Mar 20, 2017

Closed on #900

@giggio giggio closed this Mar 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.