diff options
author | David Nadlinger <code@klickverbot.at> | 2011-03-13 00:32:26 +0000 |
---|---|---|
committer | David Nadlinger <code@klickverbot.at> | 2011-03-13 00:32:26 +0000 |
commit | ce6516fb4ca0b749b6614dce67302d0cdf1e746e (patch) | |
tree | 14a27a24574ccaa1c5607ffbf4c7ca1ef1d58da7 /Examples/test-suite/d/nspace_extend_runme.1.d | |
parent | a63cde3827e6c86ca4de28b25a7d3a29cbebc1ca (diff) | |
download | swig-ce6516fb4ca0b749b6614dce67302d0cdf1e746e.tar.gz |
[D] nspace support.
As for C# and Java, this doesn't work for free functions/variables yet.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12534 626c5289-ae23-0410-ae9c-e8d60b6d4f22
Diffstat (limited to 'Examples/test-suite/d/nspace_extend_runme.1.d')
-rw-r--r-- | Examples/test-suite/d/nspace_extend_runme.1.d | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/Examples/test-suite/d/nspace_extend_runme.1.d b/Examples/test-suite/d/nspace_extend_runme.1.d new file mode 100644 index 000000000..82ccfec90 --- /dev/null +++ b/Examples/test-suite/d/nspace_extend_runme.1.d @@ -0,0 +1,32 @@ +module nspace_extend_runme; + +static import oi1c = nspace_extend.Outer.Inner1.Color; +static import oi2c = nspace_extend.Outer.Inner2.Color; + +void main() { + { + // constructors and destructors + scope color1 = new oi1c.Color(); + scope color = new oi1c.Color(color1); + + // class methods + color.colorInstanceMethod(20.0); + oi1c.Color.colorStaticMethod(20.0); + auto created = oi1c.Color.create(); + } + { + // constructors and destructors + scope color2 = new oi2c.Color(); + scope color = new oi2c.Color(color2); + + // class methods + color.colorInstanceMethod(20.0); + oi2c.Color.colorStaticMethod(20.0); + auto created = oi2c.Color.create(); + + // Same class different namespaces + auto col1 = new oi1c.Color(); + auto col2 = oi2c.Color.create(); + col2.colors(col1, col1, col2, col2, col2); + } +} |