www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 1193] New: regression: "matches more than one template declaration" doesn't list the location of the conflicting templates

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1193

           Summary: regression: "matches more than one template declaration"
                    doesn't list the location of the conflicting templates
           Product: D
           Version: 1.013
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: regression
          Priority: P3
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: thomas-dloop kuehne.cn
















DMD-1.010:
nocompile/t/template_25_A.d(18): template 
dstress.nocompile.t.template_25_A.fn(T) conflicts with 
dstress.nocompile.t.template_25_A.fn(T) at nocompile/t/template_25_A.d(13)

DMD-1.013:
nocompile/t/template_25_A.d(24): mixin fn!(int) matches more than one template 
declaration, fn(T) and fn(T)

test cases:
http://dstress.kuehne.cn/nocompile/t/template_25_A.d
http://dstress.kuehne.cn/nocompile/t/template_class_17.d
http://dstress.kuehne.cn/nocompile/t/template_struct_07.d


-- 
Apr 27 2007
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1193


Brad Roberts <braddr puremagic.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch
                 CC|                            |braddr puremagic.com



---
quick easy fix for this one (against dmd 2.x, but likely applies easily enough
to 1.x):

diff --git a/src/template.c b/src/template.c
--- a/src/template.c
+++ b/src/template.c
   -4313,8 +4313,10    TemplateDeclaration
*TemplateInstance::findBestMatch(Scope *sc)
     }
     if (td_ambig)
     {
-        error("%s matches more than one template declaration, %s and %s",
-                toChars(), td_best->toChars(), td_ambig->toChars());
+        error("%s matches more than one template declaration, %s(%d):%s and
%s(%d):%s",
+                toChars(),
+                td_best->loc.filename, td_best->loc.linnum,
td_best->toChars(),
+                td_ambig->loc.filename, td_ambig->loc.linnum,
td_ambig->toChars());
     }

     /* The best match is td_best

Results in:
bug1193.d(12): Error: mixin fn!(int) matches more than one template
declaration, bug1193.d(1):fn(T) and bug1193.d(6):fn(T)

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
May 19 2010
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1193


Walter Bright <bugzilla digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |bugzilla digitalmars.com
         Resolution|                            |FIXED



00:49:58 PDT ---
http://www.dsource.org/projects/dmd/changeset/515

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