Bug 6481 – composition with alias this doesn't work inside the struct

Status
RESOLVED
Resolution
DUPLICATE
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2011-08-12T12:56:00Z
Last change time
2011-08-14T07:32:32Z
Keywords
rejects-valid
Assigned to
nobody
Creator
hoganmeier

Comments

Comment #0 by hoganmeier — 2011-08-12T12:56:34Z
struct Memory { int foo; } struct Image { Memory sup; alias sup this; void bla() { foo = 1; } } $ dmd -c test.d DMD v2.054 DEBUG test.d(12): Error: undefined identifier foo Using this.foo = 1 fixes it.
Comment #1 by hoganmeier — 2011-08-14T07:32:32Z
*** This issue has been marked as a duplicate of issue 2787 ***