[vala/0.36: 108/173] girparser: Handle metadata for fields inside a transparent union



commit 4082018bd10049ceac339d31d7b93ddd70fc9dbf
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Thu Dec 7 17:32:54 2017 +0100

    girparser: Handle metadata for fields inside a transparent union

 vala/valagirparser.vala |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/vala/valagirparser.vala b/vala/valagirparser.vala
index 192ac1a..cdac233 100644
--- a/vala/valagirparser.vala
+++ b/vala/valagirparser.vala
@@ -1581,6 +1581,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;
                }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]