PageRenderTime 44ms CodeModel.GetById 19ms RepoModel.GetById 0ms app.codeStats 0ms

/trunk/Examples/test-suite/octave/nondynamic_runme.m

#
MATLAB | 36 lines | 27 code | 9 blank | 0 comment | 4 complexity | c603b63d164d603d6508a99fc3b525c6 MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
  1. nondynamic
  2. aa = nondynamic.A();
  3. aa.a = 1;
  4. aa.b = 2;
  5. try
  6. aa.c = 2;
  7. err = 0;
  8. catch
  9. err = 1;
  10. end_try_catch
  11. if (!err)
  12. error("A is not static")
  13. endif
  14. B=@() subclass(nondynamic.A(),'c',4);
  15. bb = B();
  16. bb.c = 3;
  17. try
  18. bb.d = 2
  19. err = 0
  20. catch
  21. err = 1
  22. end_try_catch
  23. if (!err)
  24. error("B is not static")
  25. endif
  26. cc = nondynamic.C();
  27. cc.d = 3;