[Issue 4573] New: Specialized functions conflict with generic function

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Aug 2 17:54:55 PDT 2010


http://d.puremagic.com/issues/show_bug.cgi?id=4573

           Summary: Specialized functions conflict with generic function
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: andrej.mitrovich at gmail.com


--- Comment #0 from Andrej Mitrovic <andrej.mitrovich at gmail.com> 2010-08-02 17:54:55 PDT ---
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)

-- 
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