Bug 13564 – [REG2.065] nested struct destructor trying to access members of a global class fail to compile
Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-10-01T20:16:00Z
Last change time
2015-02-18T03:37:48Z
Keywords
pull, rejects-valid
Assigned to
nobody
Creator
ace17
Comments
Comment #0 by ace17 — 2014-10-01T20:16:39Z
The following code used to compile, but doesn't anymore:
class Element(T)
{
int pos;
}
class Container(T)
{
struct Structure
{
~this()
{
Container!int c;
c.element.pos = 0;
}
}
Element!T element;
}
void f()
{
new Container!int ();
}
ace@ANTEC /tmp % dmd yo.d
yo.d(13): Error: no property 'pos' for type 'Element!int'
yo.d(22): Error: template instance yo.Container!int error instantiating
It doesn't occur if "Structure" is moved out of "Container".
It doesn't occur if the destructor is replaced by a regular function.
Is this normal?