[vala/staging: 2/2] vala: Report error on missing gio-2.0 package for async constructors
- From: Rico Tzschichholz <ricotz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/staging: 2/2] vala: Report error on missing gio-2.0 package for async constructors
- Date: Thu, 25 Nov 2021 19:26:54 +0000 (UTC)
commit 56bc6881feaeee290ced6201cae5459107f49ae7
Author: Rico Tzschichholz <ricotz ubuntu com>
Date: Thu Nov 25 20:22:00 2021 +0100
vala: Report error on missing gio-2.0 package for async constructors
Fixes https://gitlab.gnome.org/GNOME/vala/issues/1256
vala/valacreationmethod.vala | 6 ++++++
1 file changed, 6 insertions(+)
---
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;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]