Static function conflicts with Non-Static?!

Jacob Carlborg doob at me.com
Sat Jun 2 09:40:38 PDT 2012


On 2012-06-02 10:06, 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]

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

-- 
/Jacob Carlborg


More information about the Digitalmars-d-learn mailing list