]> 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>
Sat, 9 Dec 2017 13:37:04 +0000 (14:37 +0100)
vala/valagirparser.vala

index 5d54b5e46fa3164020ef13e6c037fddcd6e858eb..07a66e10fd3afa3181f8888d232fa4a37aec82c3 100644 (file)
@@ -1586,6 +1586,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;
                }