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

Field/Property assigned via await is not detected when field/property is only an IDisposable #123

Open
3 tasks done
BADF00D opened this issue Aug 13, 2019 · 3 comments
Open
3 tasks done
Labels
Milestone

Comments

@BADF00D
Copy link
Owner

BADF00D commented Aug 13, 2019

Prerequisites

  • I have written a descriptive issue title
  • I have verified that I am running the latest version of DisposableFixer: 1.6.0
  • I have searched open and closed issues to ensure it has not already been reported

Description

When I assigned an MemoryStream via await to a field that is an not disposed IDisposable, this is not detected.

Source Code

namespace SomeNamespace
{
    public class SomeClass
    {
        private IDisposable _mem;

        public async Task Do()
        {
            _mem = await Create();
        }
        public Task<MemoryStream> Create()
        {
            return Task.FromResult(new MemoryStream());
        }
    }
}

Screenshot

image

@BADF00D BADF00D added the bug label Aug 13, 2019
BADF00D added a commit that referenced this issue Sep 13, 2019
BADF00D added a commit that referenced this issue Sep 13, 2019
@BADF00D
Copy link
Owner Author

BADF00D commented Sep 13, 2019

the problem is, that GetAwaitExpressionInfo returns null, This might by a problem in roslyn fixed in version 3.x. But in order to upgrade to these, first we have to migrate to .Net Standard 2.0

@BADF00D BADF00D added this to the Release 3.0.0 milestone Sep 13, 2019
@BADF00D
Copy link
Owner Author

BADF00D commented Sep 20, 2019

Blocked by #126

@BADF00D BADF00D added the blocked Identified issues that can't be solved until other issues are solved label Sep 20, 2019
@BADF00D
Copy link
Owner Author

BADF00D commented Nov 8, 2019

Same result with Roslyn 3.3.1

@BADF00D BADF00D removed the blocked Identified issues that can't be solved until other issues are solved label Nov 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant