using System; public class Test { public class Base { } public class A : Base { } public class B : Base { } public static void Main() { A a = new A(); B b = (B)a; } }
Standard input is empty
prog.cs(15,15): error CS0030: Cannot convert type `Test.A' to `Test.B' Compilation failed: 1 error(s), 0 warnings
Standard output is empty