www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 11360] New: [2.064 beta] Variant fails to compile with void function().

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=11360

           Summary: [2.064 beta] Variant fails to compile with void
                    function().
           Product: D
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: regression
          Priority: P2
         Component: Phobos
        AssignedTo: nobody puremagic.com
        ReportedBy: opantm2+dbugs gmail.com


--- Comment #0 from Kapps <opantm2+dbugs gmail.com> 2013-10-25 18:11:08 PDT ---
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

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 25 2013
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=11360


Kapps <opantm2+dbugs gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull
         AssignedTo|nobody puremagic.com        |opantm2+dbugs gmail.com


--- Comment #1 from Kapps <opantm2+dbugs gmail.com> 2013-10-25 19:33:50 PDT ---
Pull request: https://github.com/D-Programming-Language/phobos/pull/1666

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 25 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=11360



--- Comment #2 from github-bugzilla puremagic.com 2013-10-26 06:08:58 PDT ---
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.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 26 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=11360


Kenji Hara <k.hara.pg gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |rejects-valid
             Status|NEW                         |RESOLVED
            Version|unspecified                 |D2
         Resolution|                            |FIXED


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 26 2013
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=11360


Andrej Mitrovic <andrej.mitrovich gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |andrej.mitrovich gmail.com


--- Comment #3 from Andrej Mitrovic <andrej.mitrovich gmail.com> 2013-10-26
11:17:56 PDT ---
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.

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