[Issue 6579] Calling static method should *require* using type and not instance, unless specified by author

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Jun 3 06:40:59 PDT 2012


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



--- Comment #5 from art.08.09 at gmail.com 2012-06-03 06:42:55 PDT ---
(In reply to comment #4)
> 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 is a very good argument. opCall&co are a bit special, but doing that
should be possible w/o special-casing them.

> This behavior is not doing any good anyway.

It has worked like that for a long time, and it is useful sometimes.

But the old behavior can be easily emulated with something like

   static int f() {};
   auto f(A...)(A a) { return typeof(this).f(a); }

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


More information about the Digitalmars-d-bugs mailing list