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

CC0022: Does not recognize the new C# 8 using statements #1040

Open
MischaVreeburg opened this issue Dec 15, 2019 · 1 comment
Open

CC0022: Does not recognize the new C# 8 using statements #1040

MischaVreeburg opened this issue Dec 15, 2019 · 1 comment

Comments

@MischaVreeburg
Copy link

CodeCracker is not currently considering the using pattern, as it ignores the using FileStream f = new FileStream(@"C:\users\jaredpar\using.md"); statement.

pattern-based using: https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/proposals/csharp-8.0/using

CodeCracker will output a CC0022 even if the field is disposed:
`if (...)
{
using FileStream f = new FileStream(@"C:\users\jaredpar\using.md");
// statements
}

// Equivalent to
if (...)
{
using (FileStream f = new FileStream(@"C:\users\jaredpar\using.md"))
{
// statements
}
}`

Code cracker should not report a cc0022 for this new pattern

@carloscds
Copy link
Contributor

carloscds commented Dec 15, 2019

@MischaVreeburg We don't have C# 8 for now!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants