Can call static method with null reference

Jacob Carlborg doob at me.com
Sun Jun 23 08:04:27 PDT 2013


On 2013-06-23 12:04, Jonathan M Davis wrote:

> I would have thought that that was obvious, and I fail to see why that would
> be a problem. The only risk I see in allowing static and non-static functions
> to be overloaded, is that if you have static function being called with an
> instance, and you add a non-static overload, then the code would silently
> change to call the non-static function. But we have that exact same problem
> with UFCS and member functions as it is, and that wouldn't break any existing
> code (since you can't overload on static right now). It would just be a future
> risk of breaking code.

That's true, I didn't think of that.

-- 
/Jacob Carlborg


More information about the Digitalmars-d-learn mailing list