From: Rico Tzschichholz Date: Mon, 27 Jul 2020 16:10:38 +0000 (+0200) Subject: girwriter: Don't include symbols outside of a namespace X-Git-Tag: 0.49.1~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e986124b4718d6ab24cfd66f3d9575b2eb4af447;p=thirdparty%2Fvala.git girwriter: Don't include symbols outside of a namespace Additionally report a warning for symbols which doesn't fulfill this rule. Fixes https://gitlab.gnome.org/GNOME/vala/issues/241 --- diff --git a/codegen/valagirwriter.vala b/codegen/valagirwriter.vala index 2ae748bf0..03b064314 100644 --- a/codegen/valagirwriter.vala +++ b/codegen/valagirwriter.vala @@ -392,6 +392,10 @@ public class Vala.GIRWriter : CodeVisitor { return; } + if (!has_namespace (cl)) { + return; + } + if (!(hierarchy[0] is Namespace)) { deferred.add (cl); return; @@ -604,6 +608,10 @@ public class Vala.GIRWriter : CodeVisitor { return; } + if (!has_namespace (st)) { + return; + } + if (!(hierarchy[0] is Namespace)) { deferred.add (st); return; @@ -642,6 +650,10 @@ public class Vala.GIRWriter : CodeVisitor { return; } + if (!has_namespace (iface)) { + return; + } + if (!(hierarchy[0] is Namespace)) { deferred.add (iface); return; @@ -807,6 +819,10 @@ public class Vala.GIRWriter : CodeVisitor { return; } + if (!has_namespace (en)) { + return; + } + if (!(hierarchy[0] is Namespace)) { deferred.add (en); return; @@ -881,6 +897,10 @@ public class Vala.GIRWriter : CodeVisitor { return; } + if (!has_namespace (edomain)) { + return; + } + write_indent (); buffer.append_printf ("