methods/bug599892.vala \
methods/bug613483.vala \
methods/bug615450.test \
+ methods/bug620673.test \
methods/bug620673.vala \
methods/bug622570.vala \
methods/bug626783.vala \
delegates/casting.vala \
delegates/delegates.vala \
delegates/delegates-error.test \
+ delegates/fields.vala \
delegates/reference_transfer.vala \
+ delegates/wrapper.vala \
+ delegates/bug519949.test \
delegates/bug539166.vala \
delegates/bug595610.vala \
delegates/bug595639.vala \
delegates/bug598869.test \
+ delegates/bug632017.test \
delegates/bug638415.vala \
delegates/bug639751.vala \
delegates/bug659778.vala \
objects/test-026.vala \
objects/test-029.vala \
objects/test-034.vala \
+ objects/bug541728.test \
+ objects/bug564011.test \
+ objects/bug564090.test \
objects/bug566909.vala \
+ objects/bug574146.test \
+ objects/bug585344.test \
objects/bug587905.test \
objects/bug588203.vala \
objects/bug589928.vala \
objects/bug779955.vala \
objects/bug783897.vala \
objects/bug788964.vala \
+ errors/catch-error-code.vala \
errors/errors.vala \
errors/bug567181.vala \
errors/bug579101.vala \
asynchronous/bug599568.vala \
asynchronous/bug600827.vala \
asynchronous/bug601558.vala \
+ asynchronous/bug612641.vala \
asynchronous/bug613484.vala \
asynchronous/bug614294.vala \
asynchronous/bug620740.vala \
+ asynchronous/bug626053.vala \
asynchronous/bug639591.vala \
asynchronous/bug640721.vala \
asynchronous/bug641182.vala \
--- /dev/null
+delegate void FooFunc ();
+
+class Foo {
+ async FooFunc foo () {
+ return () => {};
+ }
+}
+
+void main () {
+}
--- /dev/null
+class Foo {
+ async string[] foo () {
+ return { "foo", "bar" };
+ }
+}
+
+void main () {
+}
--- /dev/null
+Invalid Code
+
+delegate void FooFunc ();
+
+class Foo<G> {
+}
+
+void main () {
+ var foo = new Foo<FooFunc> ();
+}
--- /dev/null
+Invalid Code
+
+delegate void FooFunc ();
+
+void main() {
+ var array = new FooFunc[3];
+}
--- /dev/null
+delegate void FooFunc ();
+
+[CCode (has_target = false)]
+delegate void FooFuncTargetless ();
+
+FooFunc foo;
+unowned FooFunc foo_unowned;
+FooFuncTargetless foo_targetless;
+
+void func () {
+}
+
+void main () {
+ foo = func;
+ foo_unowned = func;
+ foo_targetless = func;
+}
--- /dev/null
+delegate void FooFunc ([CCode (array_length = false, array_null_terminated = true)] string[] a);
+delegate void BarFunc (owned FooFunc func);
+
+void foo (string[] a) {
+ assert (a.length == 2);
+ assert (a[1] == "bar");
+}
+
+void bar (owned FooFunc func) {
+ string[] ia = { "foo", "bar" };
+ func (ia);
+}
+
+void main () {
+ FooFunc f = foo;
+ BarFunc b = bar;
+ b ((owned) f);
+}
--- /dev/null
+errordomain FooError {
+ BAR,
+ FOO
+}
+
+void main () {
+ bool cond = false;
+ try {
+ if (cond)
+ throw new FooError.BAR ("bad");
+ throw new FooError.FOO ("worse");
+ } catch (FooError.FOO e) {
+ } catch (FooError e) {
+ assert_not_reached ();
+ }
+}
--- /dev/null
+Invalid Code
+
+void foo () {
+ va_list args = va_list ();
+}
+
+void main () {
+}
foreach (var foo3 in collection3) {
assert (foo3 == foo_instance);
}
+
+ // GLib.List
+ var list = new List<Foo> ();
+ list.append (foo_instance);
+ foreach (var e in list) {
+ assert (e == foo_instance);
+ }
+
+ // GLib.SList
+ var slist = new SList<Foo> ();
+ slist.append (foo_instance);
+ foreach (var e in slist) {
+ assert (e == foo_instance);
+ }
}
--- /dev/null
+Invalid Code
+
+class Foo {
+ public string bar { get; construct; }
+}
+
+void main () {
+}
--- /dev/null
+Invalid Code
+
+class Foo {
+ static ~Foo () {
+ }
+}
+
+void main () {
+}
--- /dev/null
+Invalid Code
+
+[Compact]
+class Foo {
+ class int x = 1;
+
+ class construct {
+ x = 2;
+ }
+}
+
+void main () {
+}
--- /dev/null
+Invalid Code
+
+class Foo : Object {
+ public int[] bar { get; construct; }
+}
+
+void main () {
+}
--- /dev/null
+Invalid Code
+
+[Compact]
+class Foo {
+}
+
+void main () {
+ var foo = new Foo ();
+ if (foo is Foo) {
+ }
+}
return true;
}
+struct FooStruct {
+ public int i;
+}
+
+void test_try_cast_value () {
+ FooStruct s = { 42 };
+ Value vs = s;
+
+ FooStruct s2 = (FooStruct) vs;
+ assert (s2.i == 42);
+
+ string[] sarray = { "hello", "vala", "world" };
+ Value va = sarray;
+
+ string[] sarray2 = (string[]) va;
+ assert (sarray[1] == "vala");
+}
+
void main () {
test_value ();
test_value_array ();
test_nullable_value ();
test_nullable_value_array ();
take_value (make_bool ());
+ test_try_cast_value ();
}