fork download
  1. using System;
  2. public class Test
  3. {
  4. public class Base {
  5. }
  6.  
  7. public class A : Base {
  8. }
  9.  
  10. public class B : Base {
  11. }
  12.  
  13. public static void Main() {
  14. A a = new A();
  15. B b = (B)a;
  16. }
  17. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cs(15,15): error CS0030: Cannot convert type `Test.A' to `Test.B'
Compilation failed: 1 error(s), 0 warnings
stdout
Standard output is empty