c# - Visual Studio debugger behaves incorrectly on .Any() in if statement -
when debug code in visual studio 2015/2017 debugger steps if statement. why that? code doesn't seem execute though.
private static async task test() { var somethingasync = await task.fromresult(0); var list = enumerable.empty<object>(); if (list.any()) ; // line reached debugger (but not executed) } if put additional code after if line not reached.
private static async task test() { var list = enumerable.empty<object>(); if (list.any()) ; // line not reached var foo = "bar"; } if assign list.any() variable , check variable, line isn't reached:
private static async task test() { var list = enumerable.empty<object>(); var haselements = list.any(); if (haselements) ; // not reach line if (list.any()) ; // line reached } the issue occurs when method async.
Comments
Post a Comment