Bug 184 – Cannot forward reference typedef within struct
Status
RESOLVED
Resolution
FIXED
Severity
minor
Priority
P3
Component
dmd
Product
D
Version
D1 (retired)
Platform
x86
OS
Windows
Creation time
2006-06-08T06:37:00Z
Last change time
2014-02-15T13:22:20Z
Keywords
rejects-valid
Assigned to
bugzilla
Creator
matti.niemenmaa+dbugzilla
Comments
Comment #0 by matti.niemenmaa+dbugzilla — 2006-06-08T06:37:04Z
struct vegetarian {
carrots areYummy;
}
typedef ptrdiff_t carrots;
--
The above code fails to compile, producing the error "size of type ptrdiff_t is not known" twice.
Changing the typedef to an alias or placing it before the struct causes it to compile correctly.
I can't think of a good reason for why this would be an actual limitation, so I think it's a bug.