Bug 11360 – [2.064 beta] Variant fails to compile with void function().

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-10-25T18:11:00Z
Last change time
2013-10-26T11:17:56Z
Keywords
pull, rejects-valid
Assigned to
opantm2+dbugs
Creator
opantm2+dbugs

Comments

Comment #0 by opantm2+dbugs — 2013-10-25T18:11:08Z
Sample: import std.variant; void t1() { } void main() { void function() fn = &t1; Variant v = fn; } Compiling: dmd test.d /Users/kapps/dev/dmd/phobos/std/variant.d(517): Error: expression (**zis)() is void and has no value /Users/kapps/dev/dmd/phobos/std/variant.d(585): Error: template instance std.variant.VariantN!(32LU).VariantN.handler!(void function()) error instantiating /Users/kapps/dev/dmd/phobos/std/variant.d(535): instantiated from here: opAssign!(void function()) test.d(9): instantiated from here: __ctor!(void function()) /Users/kapps/dev/dmd/phobos/std/variant.d(535): Error: template instance std.variant.VariantN!(32LU).VariantN.opAssign!(void function()) error instantiating test.d(9): instantiated from here: __ctor!(void function()) test.d(9): Error: template instance std.variant.VariantN!(32LU).VariantN.__ctor!(void function()) error instantiating
Comment #1 by opantm2+dbugs — 2013-10-25T19:33:50Z
Comment #2 by github-bugzilla — 2013-10-26T06:08:58Z
Commits pushed to master at https://github.com/D-Programming-Language/phobos https://github.com/D-Programming-Language/phobos/commit/042f3d428234fb65cf121b83679a47d17b0290ca Add unittests for issue 11360. https://github.com/D-Programming-Language/phobos/commit/e86ddfc81e2e61d8d8abac65002ff03a44279a38 Merge pull request #1666 from Kapps/fix11360 Fix issue 11360 - Function pointers / delegates returning void fail to compile with Variant.
Comment #3 by andrej.mitrovich — 2013-10-26T11:17:56Z
Thanks. However I think this was a git-head issue, not a beta one, since I've recently merged the pull which added opCall support where the offending line was added.