http://d.puremagic.com/issues/show_bug.cgi?id=7220


Walter Bright <bugzi...@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bugzi...@digitalmars.com


--- Comment #3 from Walter Bright <bugzi...@digitalmars.com> 2012-11-12 
20:24:17 PST ---
This gets quite a bit simpler:

---------- faulty.d -------------
module faulty;

import core.stdc.stdio;

mixin template DefineCoreType(string type)
{
    class Faulty
    {
        static int x;
      static void instance()
      {
          printf("Faulty.instance()\n");
          x = 3;
      }

      static this()
      {
          printf("Faulty.static this\n");
      }
    }
}

mixin DefineCoreType!("Faulty");
---------- bar.d -------------------------
import core.stdc.stdio,
       faulty;

static this()
{
    Faulty.instance();
    assert(Faulty.x == 3);
    printf("bar.static this\n");
}

private int main(string[] args)
{
    printf("Main\n");
    return 0;
}
------------------------------------------

dmd -lib faulty
dmd bar faulty.lib
bar

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to