[Bug 165] New: type inference fails with sizeof and circular imports
    d-bugmail at puremagic.com 
    d-bugmail at puremagic.com
       
    Tue May 30 06:58:56 PDT 2006
    
    
  
http://d.puremagic.com/bugzilla/show_bug.cgi?id=165
           Summary: type inference fails with sizeof and circular imports
           Product: D
           Version: 0.158
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: clugdbug at yahoo.com.au
This is a complicated bug, and was very hard to track down (happened in the
Win32 headers). It happens with offsetof as well as sizeof.
dmd mod1 mod2
mod2.d(11): no property 'pig' for type 'sheep'
===================
File mod1.d
----------
module mod1;
import mod2;
struct wolf {
 int armadillo;
}
---------------
FILE mod2.d
----------------
module mod2;
import mod1;
struct dog {
        wolf   donkey;
        struct sheep {
                char pig;
        }
}
// this fails...
const cow = dog.sheep.pig.sizeof;
// ...but this works:
//const int cow = dog.sheep.pig.sizeof;
----------------
-- 
    
    
More information about the Digitalmars-d-bugs
mailing list