Re: [Vala] access static method



I bit busy atm. Result without static keyword in the namespace is the same.

gl

On Tue, Mar 26, 2019, 16:49 Wolfgang Mauer <wolfgang mauer kabelmail de>
wrote:

I can not explain why that does not work for me, I have renamed the static method nowNevertheless many 
thanks...


Am 26.03.19 um 17:26 schrieb Wolfgang Mauer:

namespace MyNamespace {

    public static void static_method () {
        print ("This is the namespace static method\n");
    }

    public class MyClass : Object {

        public static void static_method () {
            print ("This is the class method\n");
        }

        public void some_method () {
            static_method ();
            MyNamespace.static_method ();
            MyNamespace.MyClass.static_method ();
        }


        public static void main () {
            var a = new MyClass ();

            a.some_method ();
        }
    }
}




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]