Thread overview
[Issue 343] New: Compile error using mixin containing struct
Sep 11, 2006
d-bugmail
Sep 13, 2006
Thomas Kuehne
Nov 25, 2006
d-bugmail
September 11, 2006
http://d.puremagic.com/issues/show_bug.cgi?id=343

           Summary: Compile error using mixin containing struct
           Product: D
           Version: 0.166
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla@digitalmars.com
        ReportedBy: sean@f4.ca


Compiling:

    struct S
    {
        void* function(void*) fn;
    }

    template M()
    {
        S s;
    }

    void main()
    {
        mixin M;
    }

Gives:

    test.d(8): cannot implicitly convert expression (0) of type int to S
    test.d(8): cannot cast int to S
    test.d(8): cannot cast int to S

However, compiling:

    struct S
    {
        void* function(void*) fn;
    }

    template M()
    {
        S s = void;
    }

    void main()
    {
        mixin M;
    }

Works fine:

C:\code\src\d\test>dmd test c:\bin\dmd\bin\..\..\dm\bin\link.exe test,,,user32+kernel32/noi;

C:\code\src\d\test>


-- 

September 13, 2006
d-bugmail@puremagic.com schrieb am 2006-09-11:
> http://d.puremagic.com/issues/show_bug.cgi?id=343

> Compiling:
>
>     struct S
>     {
>         void* function(void*) fn;
>     }
>
>     template M()
>     {
>         S s;
>     }
>
>     void main()
>     {
>         mixin M;
>     }
>
> Gives:
>
>     test.d(8): cannot implicitly convert expression (0) of type int to S
>     test.d(8): cannot cast int to S
>     test.d(8): cannot cast int to S

<snip>

Added to DStress as http://dstress.kuehne.cn/run/m/mixin_24_A.d http://dstress.kuehne.cn/run/m/mixin_24_B.d http://dstress.kuehne.cn/run/m/mixin_24_C.d http://dstress.kuehne.cn/run/m/mixin_24_D.d

Thomas


November 25, 2006
http://d.puremagic.com/issues/show_bug.cgi?id=343


bugzilla@digitalmars.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED




------- Comment #2 from bugzilla@digitalmars.com  2006-11-25 03:28 -------
Fixed DMD 0.175


--