Bug 165 – type inference fails with sizeof and circular imports

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D1 (retired)
Platform
x86
OS
Windows
Creation time
2006-05-30T08:58:00Z
Last change time
2014-02-15T13:19:32Z
Keywords
rejects-valid
Assigned to
bugzilla
Creator
clugdbug

Comments

Comment #0 by clugdbug — 2006-05-30T08:58:54Z
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; ----------------
Comment #1 by thomas-dloop — 2007-01-23T06:05:26Z