]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
girparser: Handle metadata for fields inside a transparent union
authorRico Tzschichholz <ricotz@ubuntu.com>
Thu, 7 Dec 2017 16:32:54 +0000 (17:32 +0100)
committerRico Tzschichholz <ricotz@ubuntu.com>
Fri, 8 Dec 2017 23:36:59 +0000 (00:36 +0100)
vala/valagirparser.vala

index c4a6bf9214fdd3b387669fa14389550543e1b56a..a63b90da6ec874cd5efcacd6e8664d3f674de318 100644 (file)
@@ -1592,6 +1592,10 @@ public class Vala.GirParser : CodeVisitor {
                if (child_name == null) {
                        child_name = reader.get_attribute ("glib:name");
                }
+               // Give a transparent union the generic name "union"
+               if (selector == "union" && child_name == null) {
+                       child_name = "union";
+               }
                if (child_name == null) {
                        return Metadata.empty;
                }