[Issue 12039] New: "tupleof" ignores named unions

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Jan 29 23:45:45 PST 2014


https://d.puremagic.com/issues/show_bug.cgi?id=12039

           Summary: "tupleof" ignores named unions
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: major
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: monarchdodra at gmail.com


--- Comment #0 from monarchdodra at gmail.com 2014-01-29 23:45:43 PST ---
Using tupleof, named unions are not taken into account. Anonymous unions seem
to work "just fine":

//----
import std.stdio;
import std.traits;

void main() 
{
    S s;
    writeln(s.tupleof);
    writeln(FieldTypeTuple!S.stringof);
}
//----

//----
struct S
{
    union
    {   
        int a;
        int b;
    }   
}
//Produces:
00
(int, int)
//----

//----
struct S
{
    union u
    {   
        int a;
        int b;
    }   
}
//Produces:

()
//----

This is quite bothersome, as it impacts FieldTypeTuple too.

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


More information about the Digitalmars-d-bugs mailing list