]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
girparser: Issue a warning for `record` inside `transparent union`
authorRico Tzschichholz <ricotz@ubuntu.com>
Tue, 20 Feb 2024 12:06:17 +0000 (13:06 +0100)
committerRico Tzschichholz <ricotz@ubuntu.com>
Tue, 20 Feb 2024 12:06:17 +0000 (13:06 +0100)
This prevents aborting on a fatal error

vala/valagirparser.vala

index ed685cd7f11f46ec5f2a1222f600b836db2f36bf..055a1fbb542649bb6a97a90d7e7f91a39a566d5e 100644 (file)
@@ -3814,6 +3814,9 @@ public class Vala.GirParser : CodeVisitor {
 
                                if (reader.name == "field") {
                                        parse_field ();
+                               } else if (reader.name == "record") {
+                                       Report.warning (get_current_src (), "unhandled child element `%s' in `transparent union'", reader.name);
+                                       skip_element ();
                                } else {
                                        // error
                                        Report.error (get_current_src (), "unknown child element `%s' in `transparent union'", reader.name);