www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 12191] New: bad purity propagation for double-nested delegate templates

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 puremagic.com
        ReportedBy: thecybershadow gmail.com


--- Comment #0 from Vladimir Panteleev <thecybershadow 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: -------
Feb 18 2014