Skip to content

Instantly share code, notes, and snippets.

@DavidKarlas
Created June 9, 2015 06:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DavidKarlas/f37b958ac77b1d22aa7c to your computer and use it in GitHub Desktop.
Save DavidKarlas/f37b958ac77b1d22aa7c to your computer and use it in GitHub Desktop.
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