You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
BUG: Error AD0001 Analyzer 'CodeCracker.CSharp.Usage.DisposableVariableNotDisposedAnalyzer' threw an exception of type 'System.ArgumentNullException' with message 'Value cannot be null. Parameter name: syntax'.
#1039
#Bug
CodeCracker throws an exception when building code below.
// The code that reproduces the bugpublicclassA:IDisposable{publicvoidDispose(){
GC.SuppressFinalize(this);}}publicclassB{publicstatic B CreateB(Aobj){returnnew B(obj);}publicB(Aobj){Obj=obj;}privatereadonlyAObj;}publicclassTest{publicasyncstatic Task ConfigureSmthAsync(){if(!(new C()).IsSmth())return;vara=new A();varb=await Task.Run(()=> B.CreateB(a));}}publicclassC{publicC(){Variable=true;}publicboolIsSmth()=> Variable;privatereadonlyboolVariable;}classProgram{staticvoidMain(){vartest=new Test();
Test.ConfigureSmthAsync().Wait();}}
Interesting thing that simple change of if() statement removes error.
#Bug
CodeCracker throws an exception when building code below.
Interesting thing that simple change of
if()
statement removes error.Don't know if it is important, but error is not appearing when
A
is not inherit fromIDisposable
.ConfigureSmthAsync
is not async.I managed to get call stack of the error.
I couldn't find similar bug and I am using last release version of the Code Cracker (1.1.0). From NuGet I have only Code Cracker insalled.
The text was updated successfully, but these errors were encountered: