Skip to content

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

@MischaVreeburg

Description

@MischaVreeburg

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions