[Vala] Segfault



Hi everyone,

I'm very new to vala (know it since yesterday). Right now I'm through the
tutroial.

I was playing around with classes and interfaces a bit.

While trying out some stuff I produced this code:

I have no idea why I produce a segfault in the line below.

I would be very happy if someone could help me.

class SuperClass : AnotherClass {

    private int data;

    public SuperClass(int data) {
        this.data = data;
        stdout.printf("3");
        //base(); ////// Here is a segfault
//////////////////////////////////////
    }

}
public class AnotherClass : GLib.Object{
    public AnotherClass(){

        stdout.printf("\nA");
    }
}
public interface ITest: AnotherClass {
    public abstract int data_1 { get; set; }
    public abstract void method_1();
}

class SubClass : SuperClass, ITest {

    public SubClass() {
        stdout.printf("2");
        base(10);

    }
    public int data_1 { get; set; }
    public void method_1(){
        stdout.printf("\n method 1");
    }
}
void main(){
    stdout.printf("0");
    SubClass s = new SubClass();
    s.method_1();
    stdout.printf("1");
    s = s ?? null;
}


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