[Issue 10346] New: No line number error with undefined template identifier

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Jun 12 15:07:15 PDT 2013


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

           Summary: No line number error with undefined template
                    identifier
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Keywords: diagnostic
          Severity: major
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: bearophile_hugs at eml.cc


--- Comment #0 from bearophile_hugs at eml.cc 2013-06-12 15:07:14 PDT ---
This is wrong code:


struct Foo(T) {}
void bar(T x, T)(Foo!T) {}
void main() {
    Foo!int spam;
    bar!10(spam);
}


DMD 2.064alpha gives an error with no line number:

Error: undefined identifier T
test.d(5): Error: template test.bar does not match any function template
declaration. Candidates are:
test.d(2):        test.bar(T x, T)(Foo!(T))
test.d(5): Error: template test.bar(T x, T)(Foo!(T)) cannot deduce template
function from argument types !(10)(Foo!(int))
test.d(5): Error: template instance bar!(10) errors instantiating template

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


More information about the Digitalmars-d-bugs mailing list