www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 11907] New: No undeclared identifier error in lambda alias argument

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

           Summary: No undeclared identifier error in lambda alias
                    argument
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: peter.alexander.au gmail.com



03:02:46 PST ---
void f(alias a)() if (is(typeof(a()))) {}

void main()
{
    f!(x => blarg);
}


This gives the error:

foo.d(5): Error: template instance f!((x) => blarg) does not match template
declaration f(alias a)() if (is(typeof(a())))

Ideally, the error would be:

foo.d(5): Error: undeclared identifier 'blarg'


This comes up all the time when using predicates on Phobos functions when you
forget an import or just have a typo.

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