[Issue 1006] New: no ambiguity error given if getting function address

Kirk McDonald kirklin.mcdonald at gmail.com
Sat Feb 24 12:02:14 PST 2007


d-bugmail at puremagic.com wrote:
> http://d.puremagic.com/issues/show_bug.cgi?id=1006
> 
>            Summary: no ambiguity error given if getting function address
>            Product: D
>            Version: 1.007
>           Platform: PC
>         OS/Version: Linux
>             Status: NEW
>           Severity: normal
>           Priority: P2
>          Component: DMD
>         AssignedTo: bugzilla at digitalmars.com
>         ReportedBy: benoit at tionex.de
> 
> 
> this compiles without error.
> class C {
>     void fnc(){
>     }
>     void fnc( int a ){
>     }
>     static this(){
>         void* ptr = & fnc; //(1)
>     }
> }
> I think (1) should be rejected, because of ambiguity.
> 
> 

This should not be made an error without adding a mechanism to get all 
of the overloads of a function, for example:

C.fnc.tupleof => Tuple!(void function(), void function(int))

-- 
Kirk McDonald
http://kirkmcdonald.blogspot.com
Pyd: Connecting D and Python
http://pyd.dsource.org


More information about the Digitalmars-d-bugs mailing list