D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 4573 - [tdpl] Specialized functions conflict with generic function
Summary: [tdpl] Specialized functions conflict with generic function
Status: RESOLVED DUPLICATE of issue 2972
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: Other Windows
: P2 normal
Assignee: No Owner
URL:
Keywords: TDPL
Depends on:
Blocks:
 
Reported: 2010-08-02 17:54 UTC by Andrej Mitrovic
Modified: 2012-01-21 18:21 UTC (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Andrej Mitrovic 2010-08-02 17:54:55 UTC
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 Andrej Mitrovic 2012-01-21 18:21:01 UTC

*** This issue has been marked as a duplicate of issue 2972 ***