summaryrefslogtreecommitdiff
path: root/tests/gir
diff options
context:
space:
mode:
authorRico Tzschichholz <ricotz@ubuntu.com>2022-03-04 11:45:41 +0100
committerRico Tzschichholz <ricotz@ubuntu.com>2022-03-04 11:45:41 +0100
commitf058e9e828f494ebf8d60cabff7999f219048623 (patch)
tree9cb93e382e96a4a121cc5311bebd8c51137b8801 /tests/gir
parent90d5814449865dc1b560a90b61c890de2e312528 (diff)
downloadvala-f058e9e828f494ebf8d60cabff7999f219048623.tar.gz
girparser: Don't count instance-parameter when checking for backwards closure reference
Fixes https://gitlab.gnome.org/GNOME/vala/issues/721
Diffstat (limited to 'tests/gir')
-rw-r--r--tests/gir/delegate-closure-destroy-index-conflict.test41
1 files changed, 41 insertions, 0 deletions
diff --git a/tests/gir/delegate-closure-destroy-index-conflict.test b/tests/gir/delegate-closure-destroy-index-conflict.test
index 4bf57bfa6..449136c90 100644
--- a/tests/gir/delegate-closure-destroy-index-conflict.test
+++ b/tests/gir/delegate-closure-destroy-index-conflict.test
@@ -2,6 +2,40 @@ GIR
Input:
+<class name="Foo"
+ c:symbol-prefix="foo"
+ c:type="TestFoo"
+ parent="GLib.Object"
+ glib:type-name="TestFoo"
+ glib:get-type="test_foo_get_type"
+ glib:type-struct="FooClass">
+ <field name="parent">
+ <type name="GLib.Object" c:type="GObject"/>
+ </field>
+ <method name="function" c:identifier="test_function">
+ <return-value transfer-ownership="none">
+ <type name="none"/>
+ </return-value>
+ <parameters>
+ <instance-parameter name="self" transfer-ownership="none">
+ <type name="Test.Foo" c:type="TestFoo*"/>
+ </instance-parameter>
+ <parameter name="callback" transfer-ownership="none" allow-none="1" closure="1" scope="notified" destroy="2">
+ <type name="GLib.Func" c:type="GFunc"/>
+ </parameter>
+ <parameter name="callback_target" transfer-ownership="none" allow-none="1" closure="0">
+ <type name="gpointer" c:type="void*"/>
+ </parameter>
+ <parameter name="callback_target_destroy_notify" transfer-ownership="none" scope="call" destroy="0">
+ <type name="GLib.DestroyNotify" c:type="GDestroyNotify"/>
+ </parameter>
+ </parameters>
+ </method>
+</class>
+<record name="FooClass"
+ c:type="TestFooClass"
+ glib:is-gtype-struct-for="Foo">
+</record>
<function name="function" c:identifier="test_function">
<return-value transfer-ownership="none">
<type name="none"/>
@@ -21,5 +55,12 @@ Input:
Output:
+[CCode (cheader_filename = "test.h", type_id = "test_foo_get_type ()")]
+public class Foo : GLib.Object {
+ [CCode (has_construct_function = false)]
+ protected Foo ();
+ [CCode (cname = "test_function")]
+ public void function (owned GLib.Func? callback);
+}
[CCode (cheader_filename = "test.h")]
public static void function (owned GLib.Func? callback);