fork download
  1. using System;
  2.  
  3. public class Test
  4. {
  5. public bool Prop { get; set; }
  6.  
  7. public static void Main()
  8. {
  9. Test obj = new Test();
  10. // this is working but I can't have it on one line
  11. if (obj != null)
  12. {
  13. obj.Prop = true;
  14. }
  15.  
  16. // this is not working
  17. // t?.Prop = true;
  18. }
  19. }
Success #stdin #stdout 0.01s 13836KB
stdin
Standard input is empty
stdout
Standard output is empty