Bug 15016 – Structs with opDispatch cannot be emplaced
Status
RESOLVED
Resolution
DUPLICATE
Severity
regression
Priority
P1
Component
druntime
Product
D
Version
D2
Platform
All
OS
All
Creation time
2015-09-05T13:34:00Z
Last change time
2015-09-16T00:24:28Z
Assigned to
nobody
Creator
schuetzm
Comments
Comment #0 by schuetzm — 2015-09-05T13:34:16Z
// xx.d
import std.conv : emplace;
struct S {
auto opDispatch(string func, Args...)(Args args) { }
}
void main() {
S s = void;
emplace(&s, S.init);
}
# dmd xx.d
/home/marc/d/druntime/import/object.d(2329): Error: argument s.opDispatch!"__xpostblit" has no parent
/home/marc/d/phobos/std/conv.d(4054): Error: template instance object._postblitRecurse!(S) error instantiating
/home/marc/d/phobos/std/conv.d(4160): instantiated from here: emplaceImpl!(S)
xx.d(10): instantiated from here: emplace!(S, S)
This has been broken by the following PR:
https://github.com/D-Programming-Language/druntime/pull/1313
*** Issue 15029 has been marked as a duplicate of this issue. ***
Comment #3 by code — 2015-09-11T22:43:03Z
It seems that __traits(parent, s.opDispatch!"__xpostblit") is broken as well.
Comment #4 by code — 2015-09-11T22:58:48Z
And the actual trigger for this bug is a change in hasMember.
Comment #5 by k.hara.pg — 2015-09-16T00:24:28Z
The root problem is same with 15045, and it's fixed by the adjustment of forwarding member access behavior.
*** This issue has been marked as a duplicate of issue 15045 ***