GNOME Bugzilla – Bug 734927
Critical returning fundamental type from a signal
Last modified: 2018-05-22 15:15:22 UTC
Attempting to return a fundamental type from a signal in the example below triggers the following warning: (process:24588): GLib-GObject-CRITICAL **: g_value_take_object: assertion 'G_VALUE_HOLDS_OBJECT (value)' failed class Klass { public signal Klass emit (); public Klass () { this.emit.connect (() => { return new Klass (); }); } } void main () { var one = new Klass (); var two = one.emit (); } The code runs fine if Klass is modified to inherit from Object. Note also that the Vala tutorial and all documentation I can find claims that signals are not supported except for types that derive from Object, which this example shows to be false.
Vala docs are wrong then, signals are supported also for non-gobject.
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/vala/issues/468.