http://d.puremagic.com/issues/show_bug.cgi?id=3559
Summary: DMD 1.048+ fails to take function pointer from overloaded member functions Product: D Version: 1.051 Platform: All OS/Version: All Status: NEW Severity: regression Priority: P2 Component: DMD AssignedTo: nob...@puremagic.com ReportedBy: klickver...@gmail.com --- Comment #0 from klickver...@gmail.com 2009-11-30 08:08:06 PST --- The following code compiles and works fine on DMD 1.047 and older (DMD 1.023 was the earliest one I tested), but no longer compiles with DMD 1.048 up to DMD 1.052 because the compiler cannot »choose« the correct overload when it tries to create the delegate/function pointer. In older versions, the casts were enough of a hint. Note, however, that the code compiles without any errors if the overload I try to get the address of is the last one declared – in the example below, getting the address of »void foo( float a )« would work fine. --- template addressOf( alias fn, Type ) { const addressOf = cast( Type )&fn; } class A { void foo( float a ) {} void foo( int a ) {} void bar() { void* dg = addressOf!( foo, void function( float ) ); auto blah = cast( void delegate( float ) )&foo; if ( cast( void* )blah.funcptr == dg ) { // Stdout( "not overridden" ).newline; } else { // Stdout( "overridden" ).newline; } } } class B : A { override void foo( float a ) {} override void foo( int a ) {} } void main() { A a = new A(); a.bar; A b = new B(); b.bar; } -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------