[Issue 2227] New: Error forbidding a function template instantiation is not reported

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Jul 15 04:46:30 PDT 2008


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

           Summary: Error forbidding a function template instantiation is
                    not reported
           Product: D
           Version: 2.017
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: samukha at voliacable.com


template Bar(T)
{
    alias typeof(T.ini) Bar; // an error hidden deep in a nested template;
}

template Foo(T)
{
    alias Bar!(T) Foo;
}

void foo(T)(Foo!(T) x)
{
}

void main()
{
    foo!(int)(2);
}
----
test.d(19): template test.foo(T) does not match any function template
declaration
test.d(19): template test.foo(T) cannot deduce template function from argument
types !(int)(int)


D 1.0 reports the error in Bar as expected:
test.d(5): Error: no property 'ini' for type 'int'
test.d(10): template instance test.Bar!(int) error instantiating


-- 



More information about the Digitalmars-d-bugs mailing list