async contructor chainup broken
Submitted by Zeeshan Ali (Khattak)
Link to original bug (#712186)
Description
The following code:
public class Parent {
public async Parent () {
print ("hello from parent\n");
}
}
public class Child : Parent {
public async Child () {
yield base ();
print ("hello from child\n");
}
}
public static async void create_child () {
var child = yield new Child ();
}
public static int main (string[] args) {
create_child.begin ();
return 0;
}
leads to this:
$ valac --pkg gio-2.0 test-async-base.vala
test-async-base.vala:16.9-16.34: warning: local variable `child' declared but never used
var child = yield new Child ();
^^^^^^^^^^^^^^^^^^^^^^^^^^
** (valac:26012): CRITICAL **: vala_member_access_get_inner: assertion 'self != NULL' failed
** (valac:26012): CRITICAL **: vala_member_access_get_member_name: assertion 'self != NULL' failed
** (valac:26012): CRITICAL **: vala_member_access_get_member_name: assertion 'self != NULL' failed
/home/zeenix/progs/test/test-async-base.vala.c: In function ‘child_construct_co’:
/home/zeenix/progs/test/test-async-base.vala.c:402:2: warning: passing argument 1 of ‘parent_new_finish’ makes pointer from integer without a cast [enabled by default]
_data_->self = (Child*) parent_new_finish (_data_->object_type, _data_->_res_);
^
/home/zeenix/progs/test/test-async-base.vala.c:190:9: note: expected ‘struct GAsyncResult *’ but argument is of type ‘GType’
Parent* parent_new_finish (GAsyncResult* _res_) {
^
/home/zeenix/progs/test/test-async-base.vala.c:402:2: error: too many arguments to function ‘parent_new_finish’
_data_->self = (Child*) parent_new_finish (_data_->object_type, _data_->_res_);
^
/home/zeenix/progs/test/test-async-base.vala.c:190:9: note: declared here
Parent* parent_new_finish (GAsyncResult* _res_) {
^
/home/zeenix/progs/test/test-async-base.vala.c: In function ‘main’:
/home/zeenix/progs/test/test-async-base.vala.c:519:2: warning: ‘g_type_init’ is deprecated (declared at /usr/include/glib-2.0/gobject/gtype.h:669) [-Wdeprecated-declarations]
g_type_init ();
^
error: cc exited with status 256
Compilation failed: 1 error(s), 1 warning(s)
Version: 0.41.x
Edited by Rico Tzschichholz