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?
Comment #1 by k.hara.pg — 2014-10-02T06:11:22Z
This is a dmd regression from 2.065. https://github.com/D-Programming-Language/dmd/pull/4040
Comment #2 by github-bugzilla — 2014-10-05T05:58:16Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/e8d5e3ca38c517fff117ce0f10840ce4a99cbe1d fix Issue 13564 - nested struct destructor trying to access members of a global class fail to compile https://github.com/D-Programming-Language/dmd/commit/8e66f9610fb0fdbfa9716af6d4eb25bc558cce86 Merge pull request #4040 from 9rnsr/fix13564 [REG2.065] Issue 13564 - nested struct destructor trying to access members of a global class fail to compile
Comment #3 by github-bugzilla — 2015-02-18T03:37:48Z
Commits pushed to 2.067 at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/e8d5e3ca38c517fff117ce0f10840ce4a99cbe1d fix Issue 13564 - nested struct destructor trying to access members of a global class fail to compile https://github.com/D-Programming-Language/dmd/commit/8e66f9610fb0fdbfa9716af6d4eb25bc558cce86 Merge pull request #4040 from 9rnsr/fix13564