[Issue 12071] New: Algebraic won't take delegate returning structure

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Feb 3 23:25:23 PST 2014


https://d.puremagic.com/issues/show_bug.cgi?id=12071

           Summary: Algebraic won't take delegate returning structure
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: regression
          Priority: P2
         Component: Phobos
        AssignedTo: nobody at puremagic.com
        ReportedBy: Jesse.K.Phillips+D at gmail.com


--- Comment #0 from Jesse Phillips <Jesse.K.Phillips+D at gmail.com> 2014-02-03 23:25:18 PST ---
The following code compiled with 2.064 but fails with an error with 2.065.

import std.variant;

void main() {
    Structure example() { return Structure.init; }

    auto m = VariantTest(&example);
}

struct Structure {}
alias Algebraic!(Structure delegate()) VariantTest;
------

C:\opt\dmd\windows\bin\..\..\src\phobos\std\variant.d(559): Error: static
assert  "Cannot store a Structure in a VariantN!(8u, Structure delegate()).
Valid types are (Structure delegate())"
C:\opt\dmd\windows\bin\..\..\src\phobos\std\variant.d(531):        instantiated
from here: opAssign!(Structure)
C:\opt\dmd\windows\bin\..\..\src\phobos\std\variant.d(600):        instantiated
from here: handler!(Structure delegate())
C:\opt\dmd\windows\bin\..\..\src\phobos\std\variant.d(550):        instantiated
from here: opAssign!(Structure delegate()) test.d(6):        instantiated from
here: __ctor!(Structure delegate())

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list