[Vala] casting out parameters



How can I cast an out parameter?

public class Foo {}
public class Bar : Foo {}

void test(out Foo foo) {
  foo = new Bar ();
}

void main() {
  Bar bar;
  test (out bar);
}

a.vala:10.9-10.15: error: Argument 1: Cannot convert from `Foo' to `Bar?'




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