www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 4573] New: Specialized functions conflict with generic function

reply d-bugmail puremagic.com writes:
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 puremagic.com
        ReportedBy: andrej.mitrovich gmail.com


--- Comment #0 from Andrej Mitrovic <andrej.mitrovich 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: -------
Aug 02 2010
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=4573


Andrej Mitrovic <andrej.mitrovich gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |DUPLICATE


--- Comment #1 from Andrej Mitrovic <andrej.mitrovich gmail.com> 2012-01-21
18:21:01 PST ---
*** This issue has been marked as a duplicate of issue 2972 ***

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 21 2012