December 07, 2003 Bug 0.76 overload function matching | ||||
---|---|---|---|---|
| ||||
on its own thre is not problem, but add a param that is an alias or struct and bit and int clash .... false is a bit (well boolean [but enough said about that) and never an int ???? --------- bittest.d ----------- module bittest; import std.c.stdio; import std.c.windows.windows; struct name_space { static void func( COLORREF col, int len ) { printf( "func(int)\n" ); } static void func( COLORREF col, bit cor ) { printf( "func(bit)\n" ); } } int main( char[][] args ) { name_space.func( 0, true ); return 0; } /* bittest.d(17): function func overloads void(uint col,int len) and void(uint col,bit cor) both match argument list for func */ ---------------------------------- there is a little err in the error msg ... inout appears in the wrong place ... -------- bitlib.d ----------- module bitlib; import std.c.stdio; import std.c.windows.windows; struct name_space { static void func( COLORREF col, inout RECT r, int len ) { printf( "func(int)\n" ); } static void func( COLORREF col, inout RECT r, bit cor ) { printf( "func(bit)\n" ); } } int main( char[][] args ) { RECT r; name_space.func( 0, r, true ); return 0; } /* bitlib.d(18): function func overloads void(uint colinout ,RECT r,int len) and void(uint colinout ,RECT r,bit cor) both match argument list for func */ -------------------------- Mike. |
Copyright © 1999-2021 by the D Language Foundation