]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
vala: Report error on missing gio-2.0 package for async constructors
authorRico Tzschichholz <ricotz@ubuntu.com>
Thu, 25 Nov 2021 19:22:00 +0000 (20:22 +0100)
committerRico Tzschichholz <ricotz@ubuntu.com>
Mon, 29 Nov 2021 12:31:37 +0000 (13:31 +0100)
Fixes https://gitlab.gnome.org/GNOME/vala/issues/1256

vala/valacreationmethod.vala

index 77b311f3163a063fe4c842a65ca340be9c6ea64c..e59526dd9a789f43879e1b524a35d36f8c1e8915 100644 (file)
@@ -97,6 +97,12 @@ public class Vala.CreationMethod : Method {
                        this_parameter.check (context);
                }
 
+               if (coroutine && !external_package && !context.has_package ("gio-2.0")) {
+                       error = true;
+                       Report.error (source_reference, "gio-2.0 package required for async constructors");
+                       return false;
+               }
+
                var old_source_file = context.analyzer.current_source_file;
                var old_symbol = context.analyzer.current_symbol;