[Issue 2782] New: Parameter Names Should Be Visible In Function Template Constraints

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Apr 1 18:48:24 PDT 2009


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

           Summary: Parameter Names Should Be Visible In Function Template
                    Constraints
           Product: D
           Version: 2.016
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: dsimcha at yahoo.com


void doStuff(T)(T arg)
if(is(typeof(arg))) {
}

void main() {
    doStuff(1);
}

Results:

test7.d|6|template test7.doStuff(T) if (is(typeof(arg))) does not match any
function template declaration|
test7.d|6|template test7.doStuff(T) if (is(typeof(arg))) cannot deduce
template function from argument types !()(int)

I assume the reason this does not compile is because the symbol arg is not
visible from the template constraint.


-- 



More information about the Digitalmars-d-bugs mailing list