[Issue 12191] New: bad purity propagation for double-nested delegate templates

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Feb 18 06:45:47 PST 2014


https://d.puremagic.com/issues/show_bug.cgi?id=12191

           Summary: bad purity propagation for double-nested delegate
                    templates
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: thecybershadow at gmail.com


--- Comment #0 from Vladimir Panteleev <thecybershadow at gmail.com> 2014-02-18 16:45:41 EET ---
void fun(H)(H h)
{
    enum parameter = "";
    alias T = typeof(h.a(parameter)); // If removed, alters error message
    static if (!is(typeof(h.a(parameter)) == void))
        fun(h.a(parameter));
}

struct S(alias d)
{
    alias a = d;
}

unittest
{
    int var;

    fun
    (
        S!
        (
            (string arg)
            {
                return S!
                (
                    (/* string */ arg) // uncomment type to fix error
                    { var++; }
                )();
            }
        )()
    );
}

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


More information about the Digitalmars-d-bugs mailing list