Hi all!

The following code compiles and works, but the static methods do not have a return type. It also compiles and works if the appropiate (or auto)
return type is added to them.

-----------------8><----------------------------
import std.stdio;

class B {
    int foo () { return 1; }

    static sbar () { return "hi!"; }
    static ibar () { return 0; }
}

void main () {
    auto b = new B;
    writeln (B.sbar);
    writeln (B.ibar);
}
-----------------8><----------------------------
Is it a feature or a bug?

I've seen it being used in
https://github.com/gecko0307/dlib/blob/master/dlib/math/matrix.d

Thank's for your help!


Reply via email to