Re: [Vala] Chaining up constructors.



On Sun, 2008-11-23 at 04:53 -0500, Yu Feng wrote:
On Sun, 2008-11-23 at 10:03 +0100, Jürg Billeter wrote:
On Sun, 2008-11-23 at 00:13 -0500, Yu Feng wrote:
Both vala 0.5.1 and trunk fails to smoothly switching the parent
classes. if I have extra stuff in the creation methods.

Do you have an example or bugzilla link?

I was experiencing the problem with that piece of DOM project. this is
an abridged version:

class AAA: Object {


    public AAA() {
        int i = 10;
    }
}
class BBB: AAA {

    public int j {get; construct;}
    public BBB() {
        base();
        j = 100;
    }
}

You should use "private set" here instead of "construct" with the new
construction scheme. This shouldn't cause any issues.

Jürg




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