[Issue 11247] New: Error: typeof(i).sizeof is used as a type

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Oct 13 13:15:23 PDT 2013


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

           Summary: Error: typeof(i).sizeof is used as a type
           Product: D
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: monarchdodra at gmail.com


--- Comment #0 from monarchdodra at gmail.com 2013-10-13 13:15:22 PDT ---
Not sure what to make of this:

//----
void main()
{
    int i;

    //This is OK:
    enum N = typeof(i).sizeof;
    byte[N] a;

    //This is also OK:
    byte[int.sizeof] b;

    //This errors out
    byte[typeof(i).sizeof] b;
}
//----
Error: typeof(i).sizeof is used as a type
//----

I *think* the compiler thinks I'm declaring an AA (When I want a SA) ?

FYIW, in 2.062 and prior, the error message is:
Error: cannot resolve .property for typeof(i).sizeof

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


More information about the Digitalmars-d-bugs mailing list