GNOME Bugzilla – Bug 742621
Invalid C code when disconnecting notify signal within an async method
Last modified: 2015-01-12 14:11:53 UTC
This Vala code: async void go_async() throws Error { xyzzy.notify["b"].disconnect(on_b); } results in invalid C: test.vala: In function ‘go_async_co’: test.vala:12:69: error: ‘_tmp2_’ undeclared (first use in this function) xyzzy.notify["b"].disconnect(on_b); Looking at the generated C code: _data_->_tmp2_ = 0U; g_signal_parse_name ("notify::b", G_TYPE_OBJECT, &_data_->_tmp1_, &_tmp2_, TRUE); The address is being taken of _tmp2_ when it should be _data_->_tmp2_. I'll attach the test case as a separate file.
Created attachment 294127 [details] Minimal test case
I should add, I'm seeing this with Vala in master.
commit c0ae346ac099fb6e8bfa59dba03ac7412523183f Author: Luca Bruno <lucabru@src.gnome.org> Date: Mon Jan 12 15:09:14 2015 +0100 codegen: Fix detailed signal disconnect in async methods Fixes bug 742621 Backported to 0.26 as 71fa41b7cf2a302b8d627a4198b265e4f2305b8d This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.