All pastes #520139 Raw Edit

Anonymous

public text v1 · immutable
#520139 ·published 2007-05-29 21:10 UTC
rendered paste body
using System;

namespace Foo {
        public abstract class ClassA {
                public static bool TryParse(string msg, out ClassA foo) {
                        Console.WriteLine("ClassA says {0}", msg);
                        ClassB.TryParse(msg, out foo);
                        return true;
                }
        }

        public class ClassB : ClassA {
                public new static bool TryParse(string msg, out ClassB foo) {
                        Console.WriteLine("ClassB says {0}", msg);
                        foo = null;
                        return true;
                }
        }

        public class Bar {
                public static void Main() {
                        ClassA a;
                        ClassA.TryParse("hello", out a);
                }
        }
}