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
[Zomp.SyncMethodGenerator.CreateSyncVersion]publicasyncTask<bool>TestMethodAsync(){vartestInt=1;if(testInt is2){await Task.Delay(1);returnfalse;}if(testInt is not 2){await Task.Delay(1);returntrue;}vartestEnum= MyEnum.None;if(testEnum is MyEnum.None){await Task.Delay(1);returntrue;}if(testEnum is not MyEnum.None){await Task.Delay(1);returnfalse;}returntrue;}
the generator produces the following:
publicboolTestMethod(){vartestInt=1;if(testInt isint)//ERROR{global::System.Threading.Thread.Sleep(1);returnfalse;}if(testInt is not int)//ERROR{global::System.Threading.Thread.Sleep(1);returntrue;}vartestEnum=global::ConsoleApp181.Class1.MyEnum.None;if(testEnum isglobal::ConsoleApp181.Class1.MyEnum.None){global::System.Threading.Thread.Sleep(1);returntrue;}if(testEnum is not global::ConsoleApp181.Class1.MyEnum)//ERROR{global::System.Threading.Thread.Sleep(1);returnfalse;}returntrue;}
There are few problems with enum values and constant int values.
publicenumMyEnum{None=0,Yes=1}
The text was updated successfully, but these errors were encountered:
Consider the method:
the generator produces the following:
There are few problems with enum values and constant int values.
The text was updated successfully, but these errors were encountered: