[Issue 11907] New: No undeclared identifier error in lambda alias argument

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Jan 12 03:02:52 PST 2014


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 at puremagic.com
        ReportedBy: peter.alexander.au at gmail.com


--- Comment #0 from Peter Alexander <peter.alexander.au at gmail.com> 2014-01-12 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: -------


More information about the Digitalmars-d-bugs mailing list