]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
vala: Set is_yield_expression in async context when chaining up to async base ctor
authorRico Tzschichholz <ricotz@ubuntu.com>
Sun, 12 Dec 2021 17:47:53 +0000 (18:47 +0100)
committerRico Tzschichholz <ricotz@ubuntu.com>
Sun, 9 Jan 2022 09:11:53 +0000 (10:11 +0100)
vala-CRITICAL **: vala_member_access_get_inner: assertion 'self != NULL' failed
vala-CRITICAL **: vala_member_access_get_member_name: assertion 'self != NULL' failed

Avoid these spurious criticals and trigger the currently expected error.

vala/valacreationmethod.vala

index 9abc03007a0e00fead3fba1c5a21155a23a22913..a8910e5c3d0bea834c0fe8170c4b0872e2f99d59 100644 (file)
@@ -200,7 +200,11 @@ public class Vala.CreationMethod : Method {
                                        context.analyzer.current_symbol = body;
                                        context.analyzer.insert_block = body;
 
-                                       var stmt = new ExpressionStatement (new MethodCall (new BaseAccess (source_reference), source_reference), source_reference);
+                                       var base_call = new MethodCall (new BaseAccess (source_reference), source_reference);
+                                       if (coroutine && cl.base_class.default_construction_method.coroutine) {
+                                               base_call.is_yield_expression = true;
+                                       }
+                                       var stmt = new ExpressionStatement (base_call, source_reference);
                                        body.insert_statement (0, stmt);
                                        stmt.check (context);