[Issue 8813] New: Cannot define delegate with const/immutable/shared/inout attributes

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Oct 13 11:05:42 PDT 2012


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

           Summary: Cannot define delegate with
                    const/immutable/shared/inout attributes
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: zan77137 at nifty.com


--- Comment #0 from SHOO <zan77137 at nifty.com> 2012-10-13 11:05:38 PDT ---
This code doesn't work:
-----------------------
void main()
{
    auto dg = delegate() const { }; // NG
}
-----------------------

And, I do not know whether a cause is the same as this problem... This code
doesn't work, too.
-----------------------
import std.traits;
void main()
{
    static assert(is(FunctionTypeOf!(void delegate() const) == const)); // NG

    alias void delegate() const DG; // OK
    static assert(is(FunctionTypeOf!DG == const)); // OK
}
-----------------------

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


More information about the Digitalmars-d-bugs mailing list