]> 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>
Thu, 25 Nov 2021 19:26:37 +0000 (20:26 +0100)
Fixes https://gitlab.gnome.org/GNOME/vala/issues/1256

vala/valacreationmethod.vala

index 45adef65fbcf71815b030510c3d22f64c9235aa0..dbfd74ff6da35b506b785a467b22edb32701605e 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;