__gshared this()

Manu via Digitalmars-d digitalmars-d at puremagic.com
Mon Jul 21 23:25:34 PDT 2014


I has problems:

class T
{
__gshared int global;
int member;

this()
{
member = global;
}

__gshared this()
{
global = 10;
}
}

fatal error LNK1179: invalid or corrupt file: duplicate COMDAT
'_D2db2ui2ui1T6__ctorMFZC2db2ui2ui1T (db.ui.ui.T db.ui.ui.T.__ctor())'



Further, if I write this code:

  void f()
  {
T t = new T;
  }

Error: db.ui.ui.T.__ctor called with argument types () matches both:
     db.ui.ui.T.this()
and:
     db.ui.ui.T.this()

It seems __gshared constructors aren't working... although I thought they
did; I'm sure I've used them before in various occasions :/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20140722/81bec790/attachment.html>


More information about the Digitalmars-d mailing list