Bug 4573 – [tdpl] Specialized functions conflict with generic function
Status
RESOLVED
Resolution
DUPLICATE
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
Other
OS
Windows
Creation time
2010-08-02T17:54:00Z
Last change time
2012-01-21T18:21:01Z
Keywords
TDPL
Assigned to
nobody
Creator
andrej.mitrovich
Comments
Comment #0 by andrej.mitrovich — 2010-08-02T17:54:55Z
Taken straight from TDPL:
void main() {
}
void transmogrify(uint) { }
void transmogrify(long) { }
void transmogrify(T)(T value) { }
unittest {
transmogrify(42);
transmogrify("hello");
transmogrify(1.1);
}
test.d(28): Error: template test.transmogrify(T) conflicts with function test.transmogrify at test.d(26)
If the generic function is placed above the specialized functions, the errors will be expanded to this:
test.d(27): Error: function test.transmogrify conflicts with template test.transmogrify(T) at test.d(26)
test.d(28): Error: function test.transmogrify conflicts with template test.transmogrify(T) at test.d(26)
Comment #1 by andrej.mitrovich — 2012-01-21T18:21:01Z
*** This issue has been marked as a duplicate of issue 2972 ***