Static function conflicts with Non-Static?!

Zhenya zheny at list.ru
Sat Jun 2 01:11:24 PDT 2012


On Saturday, 2 June 2012 at 08:06:57 UTC, Namespace wrote:
> Is that a joke? :D
>
> This Code throw the error, that a call of "Load" matches both 
> functions.
> How is that possible? Even in php that works fine. Any 
> workarounds?
> I can not believe that such a simple error still exists in D.
>
> [code]
> import std.stdio;
>
> class Foo {
> public:
> 	static Foo Load() {
> 		Foo f = new Foo();
> 		f.Load();
>
> 		return f;
> 	}
>
> 	void Load() {
>
> 	}
> }
>
> void main() {
> 	Foo f = Foo.Load();
> }
> [/code]
xDDD


More information about the Digitalmars-d-learn mailing list