PageRenderTime 24ms CodeModel.GetById 1ms RepoModel.GetById 0ms app.codeStats 0ms

/trunk/Examples/test-suite/d/nspace_extend_runme.2.d

#
D | 32 lines | 22 code | 5 blank | 5 comment | 0 complexity | ddf10a8195be96a30be2f3db32b0af74 MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
  1. module nspace_extend_runme;
  2. static import oi1c = nspace_extend.Outer.Inner1.Color;
  3. static import oi2c = nspace_extend.Outer.Inner2.Color;
  4. void main() {
  5. {
  6. // constructors and destructors
  7. scope color1 = new oi1c.Color();
  8. scope color = new oi1c.Color(color1);
  9. // class methods
  10. color.colorInstanceMethod(20.0);
  11. oi1c.Color.colorStaticMethod(20.0);
  12. auto created = oi1c.Color.create();
  13. }
  14. {
  15. // constructors and destructors
  16. scope color2 = new oi2c.Color();
  17. scope color = new oi2c.Color(color2);
  18. // class methods
  19. color.colorInstanceMethod(20.0);
  20. oi2c.Color.colorStaticMethod(20.0);
  21. auto created = oi2c.Color.create();
  22. // Same class different namespaces
  23. auto col1 = new oi1c.Color();
  24. auto col2 = oi2c.Color.create();
  25. col2.colors(col1, col1, col2, col2, col2);
  26. }
  27. }