From: Rico Tzschichholz Date: Thu, 12 Jul 2018 09:33:57 +0000 (+0200) Subject: vala: Report error for error-domains without any code X-Git-Tag: 0.41.90~21 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e96b6ab9ab754fe33f6ff002ef80e371153dc716;p=thirdparty%2Fvala.git vala: Report error for error-domains without any code --- 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); }