[vala/staging] girwriter: Write missing c:type attribute of compact class record



commit c68a9d0489f4d2fdd1a4d9aee0e5c0739579bfa2
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Tue Aug 10 14:03:08 2021 +0200

    girwriter: Write missing c:type attribute of compact class record
    
    Thanks to Niels De Graef

 codegen/valagirwriter.vala               | 1 +
 tests/girwriter/GirTest-1.0.gir-expected | 4 ++--
 tests/girwriter/girtest.vapigen-expected | 2 +-
 3 files changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/codegen/valagirwriter.vala b/codegen/valagirwriter.vala
index 4548f890a..997d899ff 100644
--- a/codegen/valagirwriter.vala
+++ b/codegen/valagirwriter.vala
@@ -609,6 +609,7 @@ public class Vala.GIRWriter : CodeVisitor {
                } else {
                        write_indent ();
                        buffer.append_printf ("<record name=\"%s\"", get_gir_name (cl));
+                       write_ctype_attributes (cl);
                        write_symbol_attributes (cl);
                        buffer.append_printf (">\n");
                        indent++;
diff --git a/tests/girwriter/GirTest-1.0.gir-expected b/tests/girwriter/GirTest-1.0.gir-expected
index a7d604de4..7d30eea03 100644
--- a/tests/girwriter/GirTest-1.0.gir-expected
+++ b/tests/girwriter/GirTest-1.0.gir-expected
@@ -1830,7 +1830,7 @@
                </field>
        </record>
        <record name="ImplementionTestPrivate" c:type="GirTestImplementionTestPrivate" disguised="1"/>
-       <record name="CompactClass">
+       <record name="CompactClass" c:type="GirTestCompactClass">
                <field name="s" writable="1">
                        <type name="utf8" c:type="gchar*"/>
                </field>
@@ -1909,7 +1909,7 @@
                </field>
        </record>
        <record name="RenamedClassPrivate" c:type="GirTestNamedClassPrivate" disguised="1"/>
-       <record name="RenamedCompactClass">
+       <record name="RenamedCompactClass" c:type="GirTestNamedCompactClass">
                <field name="s" writable="1">
                        <type name="utf8" c:type="gchar*"/>
                </field>
diff --git a/tests/girwriter/girtest.vapigen-expected b/tests/girwriter/girtest.vapigen-expected
index 49084aab1..1bc67d83a 100644
--- a/tests/girwriter/girtest.vapigen-expected
+++ b/tests/girwriter/girtest.vapigen-expected
@@ -207,7 +207,7 @@ namespace GirTest {
                public static GirTest.BoxedStruct init ();
                public void inv ();
        }
-       [CCode (cheader_filename = "girtest.h", has_type_id = false)]
+       [CCode (cheader_filename = "girtest.h", cname = "GirTestNamedCompactClass", has_type_id = false)]
        public struct RenamedCompactClass {
                public weak string s;
                public int i;


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