digitalmars.D.bugs - [Bug 165] New: type inference fails with sizeof and circular imports
- d-bugmail puremagic.com (41/41) May 30 2006 http://d.puremagic.com/bugzilla/show_bug.cgi?id=165
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 digitalmars.com ReportedBy: clugdbug 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; ---------------- --
May 30 2006