[vala/staging] vala: Report error for error-domains without any code
- From: Rico Tzschichholz <ricotz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/staging] vala: Report error for error-domains without any code
- Date: Thu, 12 Jul 2018 09:48:41 +0000 (UTC)
commit e96b6ab9ab754fe33f6ff002ef80e371153dc716
Author: Rico Tzschichholz <ricotz ubuntu com>
Date: Thu Jul 12 11:33:57 2018 +0200
vala: Report error for error-domains without any code
vala/valaerrordomain.vala | 6 ++++++
1 file changed, 6 insertions(+)
---
diff --git a/vala/valaerrordomain.vala b/vala/valaerrordomain.vala
index 1c63e51f3..c0e92e70e 100644
--- a/vala/valaerrordomain.vala
+++ b/vala/valaerrordomain.vala
@@ -114,6 +114,12 @@ public class Vala.ErrorDomain : TypeSymbol {
checked = true;
+ if (codes.size <= 0) {
+ Report.error (source_reference, "Error domain `%s' requires at least one code".printf
(get_full_name ()));
+ error = true;
+ return false;
+ }
+
foreach (ErrorCode ecode in codes) {
ecode.check (context);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]