Yeah that would be good to have. Jurg? What do you think about it? You will do
in one line what we can now do with 3 and its easier to read.
I was also wondering the support for casting lambda/closure arguments like:
Foo.connect ((myclass*)x,(mytype)y) => {
});
- Original message -
On Wed, 2010-05-26 at 20:23 +0200, pancake wrote:
> And if it's a subclass? Which is what 'as' does.
>
'as' is safe. If the cast is incompatible, you
get null.
Of course vala could have been designed to allow
test(out bar as Bar)
or some other syntax to tell the compiler that
we know what we a
And if it's a subclass? Which is what 'as' does.
- Original message -
> On Wed, 2010-05-26 at 15:41 +0200, pancake wrote:
> > Would love to see this dynamic casting supported by the language..
> > Should I open a bug?
>
> As Nor Jaidi Tuah wrote, the declaration of the method `test` does n
Ok :) I got it! Thanks
On May 26, 2010, at 7:28 PM, Jürg Billeter wrote:
On Wed, 2010-05-26 at 15:41 +0200, pancake wrote:
Would love to see this dynamic casting supported by the language..
Should I open a bug?
As Nor Jaidi Tuah wrote, the declaration of the method `test` does not
guarantee
On Wed, 2010-05-26 at 15:41 +0200, pancake wrote:
> Would love to see this dynamic casting supported by the language..
> Should I open a bug?
As Nor Jaidi Tuah wrote, the declaration of the method `test` does not
guarantee that `foo` is set to an instance of `Bar`. The method could
also be impleme
Would love to see this dynamic casting supported by the language.. Should I
open a bug?
- Original message -
> On Tue, 2010-05-25 at 11:12 +0200, pancake wrote:
> > How can I cast an out parameter?
> >
> > public class Foo {}
> > public class Bar : Foo {}
> >
> > void test(out Foo foo) {
On Tue, 2010-05-25 at 11:12 +0200, pancake wrote:
> 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: Can
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?'
___