On Friday, 26 December 2014 at 17:47:29 UTC, Jacob Carlborg wrote:
On 2014-12-25 14:12, Christian Schneider wrote:
Just for my information: Why is it no longer possible to have multiple d methods (or overloaded constructors) to map to the same Objective-C

I though it was quite nice to have overloaded d constructors for the
various init.. methods.

Can you give me an example of what's not working?

previously it was possible to have a few D methods "point" to the same Objective-C method like this:

NSView initWithFrame(NSRect frameRect) @selector("initWithFrame:") ;
    this(NSRect frameRect) @selector("initWithFrame:")  ;

Now with the latest version I get this error for the above two lines:

../../Interfaces/appkit/view.d(19): Error: constructor appkit.view.NSView.this Objcective-C selector 'initWithFrame:' already in use by function 'initWithFrame'.

I thought, it was a nice convenience to make both potential types of programmers happy, those leaning more towards Objective-C / named parameters can use the verbose, first option, while the ones coming more from C/C++ can use the shortcut, the 2nd option.

But it's no big deal, I'll just remove the "shortcut". My question was more for understanding why it was a) possible in the past and b) what is the motivation behind the decision that it is no longer possible now.

Reply via email to