fork download
  1. import std.stdio;
  2.  
  3. class Test1
  4. {
  5. public:
  6. void hello()
  7. {
  8. writeln("hello.");
  9. }
  10.  
  11. private:
  12. }
  13.  
  14. void main()
  15. {
  16. Test1 t1;
  17. if (t1 is not null) writeln("o");
  18. else writeln("x");
  19.  
  20. t1 = new Test1;
  21. if (t1 is not null) writeln("o");
  22. else writeln("x");
  23.  
  24. delete t1;
  25. if (t1 is not null) writeln("o");
  26. else writeln("x");
  27.  
  28. t1 = null;
  29. if (t1 is not null) writeln("o");
  30. else writeln("x");
  31. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.d(17): found 'null' when expecting ')'
prog.d(17): found ')' instead of statement
prog.d(21): found 'null' when expecting ')'
prog.d(21): found ')' instead of statement
prog.d(25): found 'null' when expecting ')'
prog.d(25): found ')' instead of statement
prog.d(29): found 'null' when expecting ')'
prog.d(29): found ')' instead of statement
stdout
Standard output is empty