[Issue 3613] enforce cannot be called with template parameters and compile.
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Fri Oct 8 01:37:03 PDT 2010
http://d.puremagic.com/issues/show_bug.cgi?id=3613
Shin Fujishiro <rsinfu at gmail.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |rejects-valid
CC| |rsinfu at gmail.com
--- Comment #1 from Shin Fujishiro <rsinfu at gmail.com> 2010-10-08 01:36:38 PDT ---
The problem seems to be surprisingly deep... Here're reduced test cases.
This code compiles fine:
--------------------
void main()
{
test!int(-1, 10);
test!int(-1, "");
}
void test(T)(T v, int) {}
void test(T)(T v, string) {}
--------------------
While the following doesn't:
--------------------
void main()
{
test!int(-1, [10]); // (4)
test!int(-1, "");
}
void test(T)(T v, int[]) {} // (6) just changed from int -> int[]
void test(T)(T v, string) {} // (7)
--------------------
% dmd -o- -c test.d
test.d(4): Error: template test.test(T) test(T) matches more than one template
declaration, test.d(6):test(T) and test.d(7):test(T)
--
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