digitalmars.D.bugs - [Issue 1525] New: Can't instantiate template with bogus error messages
- d-bugmail puremagic.com (32/32) Sep 22 2007 http://d.puremagic.com/issues/show_bug.cgi?id=1525
- d-bugmail puremagic.com (9/9) Sep 22 2007 http://d.puremagic.com/issues/show_bug.cgi?id=1525
- d-bugmail puremagic.com (13/13) Oct 29 2007 http://d.puremagic.com/issues/show_bug.cgi?id=1525
- d-bugmail puremagic.com (17/17) Jun 12 2011 http://d.puremagic.com/issues/show_bug.cgi?id=1525
http://d.puremagic.com/issues/show_bug.cgi?id=1525 Summary: Can't instantiate template with bogus error messages Product: D Version: unspecified Platform: PC OS/Version: Windows Status: NEW Severity: normal Priority: P2 Component: DMD AssignedTo: bugzilla digitalmars.com ReportedBy: davidl 126.com template k(U:V[C]) { void func(U a, C v){writefln("hello");}; } int[char]v; char m; k!(int[char]).func(v); gives me: abc.d(7): variable abc.v conflicts with variable abc.v at abc.d(5) abc.d(1): Error: identifier 'C' is not defined abc.d(1): Error: index is not a type or an expression abc.d(1): Error: identifier 'V' is not defined abc.d(1): Error: V is used as a type modify the last line to k!(int[char]).func(v,m) gives me: abc.d(7): found ',' when expecting ')' abc.d(7): semicolon expected, not 'm' abc.d(7): no identifier for declarator m abc.d(7): semicolon expected, not ')' abc.d(7): Declaration expected, not ')' --
Sep 22 2007
http://d.puremagic.com/issues/show_bug.cgi?id=1525 davidl 126.com changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|normal |trivial ------- Comment #1 from davidl 126.com 2007-09-22 20:34 ------- this bug is for nicer error messages maybe hint user that missing template list of (U:V[C],C) for such a specialization. --
Sep 22 2007
http://d.puremagic.com/issues/show_bug.cgi?id=1525 smjg iname.com changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |smjg iname.com ------- Comment #2 from smjg iname.com 2007-10-29 08:00 ------- INVALID I think but.... template k(U:V[C], V, C) { void func(U a, C v){writefln("hello");}; } works, and can be instantiated as k!(int[int]). --
Oct 29 2007
http://d.puremagic.com/issues/show_bug.cgi?id=1525 yebblies <yebblies gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED CC| |yebblies gmail.com Resolution| |FIXED --- Comment #3 from yebblies <yebblies gmail.com> 2011-06-12 22:00:34 PDT --- Dmd now complains that V and C are undefined (dmd 1.068 & 2.053) which correctly identifies the problem. testx.d(1): Error: undefined identifier C, did you mean template k(U : V[C])? testx.d(1): Error: undefined identifier V, did you mean template k(U : V[_error_ ])? -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jun 12 2011