[nem-en] static constructor prevents use of default constructor
Valient Gough
valient at gmail.com
Fri Feb 10 05:42:50 CET 2006
Hi, tripped over another minor oddity..
If I have a class with a "static this()" constructor, then the
compiler doesn't allow use of a default constructor. The attached
test.n program fails to build with the error:
ncc -o test.exe test.n
test.n:19:19:19:23: error: none of the meanings of `Test' meets the type ?:
test.n:19:19:19:23: error: the type `Test' has no accessible constructors
The error goes away if I either define a default constructor by hand
("public this() {}"), or comment out the static constructor. C#
doesn't appear to have this constraint, which I found when I tried to
convert some SWIG generated code using cs2n.
regards,
Valient
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.n
Type: application/octet-stream
Size: 291 bytes
Desc: not available
Url : /mailman/pipermail/devel-en/attachments/20060210/df6e7798/test.obj
More information about the devel-en
mailing list