Bug 12071 – Algebraic won't take delegate returning structure

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-02-03T23:25:00Z
Last change time
2014-02-27T20:13:34Z
Keywords
pull
Assigned to
nobody
Creator
Jesse.K.Phillips+D

Comments

Comment #0 by Jesse.K.Phillips+D — 2014-02-03T23:25:18Z
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())
Comment #1 by Jesse.K.Phillips+D — 2014-02-03T23:31:30Z
Sorry, should say 2.065 beta 3
Comment #2 by k.hara.pg — 2014-02-06T00:23:13Z
Comment #3 by github-bugzilla — 2014-02-13T19:18:39Z
Commits pushed to master at https://github.com/D-Programming-Language/phobos https://github.com/D-Programming-Language/phobos/commit/1323bd4f00c2dec3fc41f105957a521a9daa84ae fix Issue 12071 - Algebraic won't take delegate returning structure Use `Variant` rather than `VariantN` in order to pack arguments and returned value in opCall. https://github.com/D-Programming-Language/phobos/commit/3089fb2d0bda4215aba712a3b6a7bef8a5a2a20c Merge pull request #1909 from 9rnsr/fix12071 [REG2.065a] Issue 12071 - Algebraic won't take delegate returning structure
Comment #4 by github-bugzilla — 2014-02-15T19:23:10Z
Commit pushed to 2.065 at https://github.com/D-Programming-Language/phobos https://github.com/D-Programming-Language/phobos/commit/d430dd14d63c68aae3dae1fc0cacc4de264ff27a Merge pull request #1909 from 9rnsr/fix12071 [REG2.065a] Issue 12071 - Algebraic won't take delegate returning structure
Comment #5 by github-bugzilla — 2014-02-27T20:13:34Z