[Issue 15016] New: Structs with opDispatch cannot be emplaced

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Sat Sep 5 06:34:16 PDT 2015


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 at puremagic.com
          Reporter: schuetzm at 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);
}


# 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

--


More information about the Digitalmars-d-bugs mailing list