Re: [Vala] Are nested interfaces disallowed?



ping.

Are nested classes/interfaces officially supported in vala?

Classes seems work fine with vala 0.10 [1], but not interfaces.


1)

public class AClass {
    public class BClass {
        public void print() {
            stdout.printf("Hello, world!\n");
        }
    }
}

void main() {
    var cl = new AClass.BClass();
    cl.print();
}


On Tue, Dec 28, 2010 at 4:42 PM, Anatol Pomozov
<anatol pomozov gmail com> wrote:
Hi,

I have a class and I want to add a nested interface into it.

public class AClass : Object {
 public interface BClass : Object { public void foo() { } }
}

Valac 0.10.0 fails with following error:

a.vala:2.2-2.33: error: unexpected declaration in class
       public interface BClass : Object {
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

This sounds weird. If I change 'interface' to 'class' valac is ok with
it and compiles my program without any error.

What is the reason of nested interfaces prohibition?




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