class list { public class Cons : list { } public class Nil : list { } } class C { public static void Rev (list y) { if (y is list.Cons) System.Console.WriteLine ("Cons"); if (y is list.Nil) System.Console.WriteLine ("Nil"); } } class M { public static void Main () { C.Rev (new list.Cons ()); C.Rev (new list.Nil ()); } }