www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 15016] New: Structs with opDispatch cannot be emplaced

https://issues.dlang.org/show_bug.cgi?id=15016

          Issue ID: 15016
           Summary: Structs with opDispatch cannot be emplaced
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: druntime
          Assignee: nobody puremagic.com
          Reporter: schuetzm gmx.net

// xx.d

import std.conv : emplace;

struct S {
    auto opDispatch(string func, Args...)(Args args) { }
}

void main() {
    S s = void;
    emplace(&s, S.init);
}



/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

--
Sep 05 2015