Issue warnings and skip such symbols to avoid errors on vala's side.
gir/parameter-nullable-out-simple-type.test \
gir/property-non-readable.test \
gir/signal-virtual.test \
+ gir/symbol-redefined.test \
gir/symbol-type-csuffix.test \
+ gir/symbol-without-name.test \
gir/union.test \
gir/union-transparent.test \
girwriter/class-final.test \
--- /dev/null
+GIR
+
+Input:
+
+<enumeration name="Test"
+ c:type="Test">
+ <member name="bar"
+ value="0"
+ c:identifier="TEST_BAR">
+ </member>
+ <member name="foo"
+ value="1"
+ c:identifier="TEST_FOO">
+ </member>
+ <member name="bar"
+ value="0"
+ c:identifier="TEST_BAR">
+ </member>
+</enumeration>
+
+Output:
+
+[CCode (cheader_filename = "test.h", cname = "Test", cprefix = "TEST_", has_type_id = false)]
+public enum Test {
+ BAR,
+ FOO
+}
--- /dev/null
+GIR
+
+Input:
+
+<function name="" c:identifier="test_foo">
+ <return-value transfer-ownership="none">
+ <type name="void"/>
+ </return-value>
+</function>
+<function name="bar" c:identifier="test_bar">
+ <return-value transfer-ownership="none">
+ <type name="void"/>
+ </return-value>
+</function>
+
+Output:
+
+[CCode (cheader_filename = "test.h")]
+public static void bar ();
const string GIR_VERSION = "1.2";
static void add_symbol_to_container (Symbol container, Symbol sym) {
+ if (sym.name == "") {
+ Report.warning (sym.source_reference, "node with empty name");
+ return;
+ } else if (sym.name != null) {
+ Symbol? old_sym = container.scope.lookup (sym.name);
+ if (old_sym != null) {
+ Report.warning (sym.source_reference, "`%s' already contains a definition for `%s'", container.name, sym.name);
+ Report.notice (old_sym.source_reference, "previous definition of `%s' was here", old_sym.name);
+ return;
+ }
+ }
+
if (container is Class) {
unowned Class cl = (Class) container;