Overloading static methods

Steven Schveighoffer schveiguy at yahoo.com
Tue Aug 30 07:28:04 PDT 2011


On Tue, 30 Aug 2011 10:19:27 -0400, Jacob Carlborg <doob at me.com> wrote:

> On 2011-08-30 14:34, Steven Schveighoffer wrote:
>> On Tue, 30 Aug 2011 07:53:15 -0400, Steven Schveighoffer
>> <schveiguy at yahoo.com> wrote:
>>
>>> On Mon, 29 Aug 2011 10:59:22 -0400, Daniel Murphy
>>> <yebblies at nospamgmail.com> wrote:
>>>
>>>> "Steven Schveighoffer" <schveiguy at yahoo.com> wrote in message
>>>> news:op.v0zckubyeav7ka at localhost.localdomain...
>>>>>
>>>>> My opinion is that static methods should *not* be callable from an
>>>>> instance, you should need typeof(instance).staticMethod. The current
>>>>> allowance is misleading.
>>>>>
>>>>> This should solve some of the issues, but of course, you'd need to
>>>>> allow
>>>>> overloading of the method name in static and non-static forms.
>>>>>
>>>>> -Steve
>>>>
>>>> I like this idea. Is there a bugzilla entry for it?
>>>
>>> I'll add it, if it's not already there.
>>
>> http://d.puremagic.com/issues/show_bug.cgi?id=6579
>>
>> -Steve
>
> As Daniel answered previously in this thread, this has already been  
> reported: http://d.puremagic.com/issues/show_bug.cgi?id=3345

It's different.  3345 is asking to allow overloading of static and  
instance methods with the same signature.  The new bug is asking to  
*require* using the type when accessing static methods/fields.

You might notice in the bug report that I mention this "paves the way for  
bug 3345" :)

-Steve


More information about the Digitalmars-d mailing list