Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
using System;
namespace cp765432
{
class MainClass
{
public static void Main(string[] args)
{
Method1(null);
}//5. But ends here
static void Method1(BaseClass arg)
{
//1. Breakpoint on line below
if (arg is Class1 ||//2. Step over on this works correctly and gets to next IF(notice only 3 checks)
arg is Class2 ||
arg is Class3)
Console.WriteLine("3");
if (arg is Class1 ||//3. Step over on this doesn't work correctly and gets out of this method(notice 4 checks)
arg is Class2 ||
arg is Class3 ||
arg is Class4)
Console.WriteLine("4");
Console.WriteLine("5");//4. Step over IF above should end here
}
class BaseClass
{
}
class Class1 : BaseClass
{
}
class Class2 : BaseClass
{
}
class Class3 : BaseClass
{
}
class Class4 : BaseClass
{
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.