[Vala] "requires" and "ensures" on setters and getters



Hello,

I tried :

class Test:Object{
        public int test{get;set requires(value > 10);}
}

but it doesn't work.

Actually I use :

class Test:Object{

        public void set_test2(int value) requires (value > 10) {
                this.test = value;
        }
        
        public int test{get; private set;}
}

Is there an other solution using "requires" ?

Thanks.

Nicolas HENRY



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