http://d.puremagic.com/issues/show_bug.cgi?id=6579


Gor Gyolchanyan <g...@boloneum.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |g...@boloneum.com


--- Comment #4 from Gor Gyolchanyan <g...@boloneum.com> 2012-06-03 05:28:22 PDT 
---
(In reply to comment #3)
> (In reply to comment #2)
> > Revised proposal:
> > 
> > One cannot call a static method using an instance method unless the author
> > aliases it into the instance namespace.
> > 
> > Andrei pointed out that one can design a static method *intending* it to be
> > used on an instance, for example to save a virtual method call when it's not
> > needed, but still implement a generic interface.
> > 
> > For the cases where a static method was intended to be callable from an
> > instance, there should be a provision for that.
> > 
> > A sample proposal:
> > 
> > struct S
> > {
> >    static void foo() {}
> >    alias foo this.foo;
> > }
> > 
> > Now an instance of S can be used to call foo.
> 
> a) I don't see any real need to separate type and instance methods
> b) OTOH i don't think it can do much harm either. But overloading alias 
> further
> does not seem like the best idea. 'static @method void foo() {}' - @method is
> needed for UFCS too, where it would do something similar.

It hinders overloading. For so long I wanted to be able to have both static and
non-static opDispatch and opCall and couldn't because of this. This behavior is
not doing any good anyway.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to