diff options
author | Rico Tzschichholz <ricotz@ubuntu.com> | 2021-11-25 20:22:00 +0100 |
---|---|---|
committer | Rico Tzschichholz <ricotz@ubuntu.com> | 2021-11-25 20:26:37 +0100 |
commit | 56bc6881feaeee290ced6201cae5459107f49ae7 (patch) | |
tree | 766aa86b455f8beb680aed6cf8f042f6f03f7525 /vala/valacreationmethod.vala | |
parent | 3e650c14e404e897dbfa76b48490aa93e5e4dfa0 (diff) | |
download | vala-56bc6881feaeee290ced6201cae5459107f49ae7.tar.gz |
vala: Report error on missing gio-2.0 package for async constructors
Fixes https://gitlab.gnome.org/GNOME/vala/issues/1256
Diffstat (limited to 'vala/valacreationmethod.vala')
-rw-r--r-- | vala/valacreationmethod.vala | 6 |
1 files changed, 6 insertions, 0 deletions
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; |