Anonymous
public text v1 · immutableusing 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);
}
}
}