[Issue 899] New: structure field .sizeof property inaccessible in the	scope
    d-bugmail at puremagic.com 
    d-bugmail at puremagic.com
       
    Sun Jan 28 08:10:43 PST 2007
    
    
  
http://d.puremagic.com/issues/show_bug.cgi?id=899
           Summary: structure field .sizeof property inaccessible in the
                    scope
           Product: D
           Version: 1.001
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: thecybershadow at gmail.com
import std.stdio;
struct Test
{
    int field;
}
void main()
{
    writefln(Test.field.offsetof);  // works
}
class Class
{
    this()
    {
        writefln(Test.field.offsetof);  
        // Error: this for field needs to be type Test not type bug2.Class
        // class bug2.Class member field is not accessible
    }
}
-- 
    
    
More information about the Digitalmars-d-bugs
mailing list