http://d.puremagic.com/issues/show_bug.cgi?id=4916

           Summary: struct VariantN does not overload ()
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nob...@puremagic.com
        ReportedBy: ah0801...@yahoo.com


--- Comment #0 from Austin Hastings <ah0801...@yahoo.com> 2010-09-22 20:11:45 
PDT ---
This code:
==============
module scratch;

import std.variant;

unittest {
    Variant v;

    int foo() { return 1; }

    v = &foo;

    v();
}
================
Produces this error:
================
$ dmd -unittest -run bronze/util/scratch.d
bronze\util\scratch.d(12): Error: struct VariantN does not overload ()
===============

IMO, this is a design flaw: Variants claim to support function and delegate
pointers, and it seems obvious that supporting them should support invoking
them. (In particular, since functions and delegates are different sizes,
Variants should be very useful in this role, except ...)

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

Reply via email to