From: Rico Tzschichholz Date: Thu, 25 Nov 2021 19:22:00 +0000 (+0100) Subject: vala: Report error on missing gio-2.0 package for async constructors X-Git-Tag: 0.55.1~60 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=56bc6881feaeee290ced6201cae5459107f49ae7;p=thirdparty%2Fvala.git vala: Report error on missing gio-2.0 package for async constructors Fixes https://gitlab.gnome.org/GNOME/vala/issues/1256 --- diff --git a/vala/valacreationmethod.vala b/vala/valacreationmethod.vala index 45adef65f..dbfd74ff6 100644 --- a/vala/valacreationmethod.vala +++ b/vala/valacreationmethod.vala @@ -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;