Example #1
0
 public void Method()
 {
     using var x = new Struct();
     var y = new Struct(); // Noncompliant
 }
        public Struct Bar()
        {
            using var disposableRefStruct = new Struct(); // Noncompliant

            return(disposableRefStruct);
        }
 public void Method()
 {
     var x = new Struct(); // Compliant - FN this struct needs to be disposed (disposable ref struct)
 }
Example #4
0
        public void M2()
        {
            using var s = new Struct();

            s.Dispose(); // Compliant - FN
        }
Example #5
0
        public Struct Bar(string path, string text)
        {
            using var disposableRefStruct = new Struct(); // Compliant - FN the resource is returned already disposed

            return(disposableRefStruct);
        }