PageRenderTime 15ms CodeModel.GetById 2ms app.highlight 9ms RepoModel.GetById 1ms 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
 1module nspace_extend_runme;
 2
 3static import oi1c = nspace_extend.Outer.Inner1.Color;
 4static import oi2c = nspace_extend.Outer.Inner2.Color;
 5
 6void main() {
 7  {
 8    // constructors and destructors
 9    scope color1 = new oi1c.Color();
10    scope color = new oi1c.Color(color1);
11
12    // class methods
13    color.colorInstanceMethod(20.0);
14    oi1c.Color.colorStaticMethod(20.0);
15    auto created = oi1c.Color.create();
16  }
17  {
18    // constructors and destructors
19    scope color2 = new oi2c.Color();
20    scope color = new oi2c.Color(color2);
21
22    // class methods
23    color.colorInstanceMethod(20.0);
24    oi2c.Color.colorStaticMethod(20.0);
25    auto created = oi2c.Color.create();
26
27    // Same class different namespaces
28    auto col1 = new oi1c.Color();
29    auto col2 = oi2c.Color.create();
30    col2.colors(col1, col1, col2, col2, col2);
31  }
32}