After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 734927 - Critical returning fundamental type from a signal
Critical returning fundamental type from a signal
Status: RESOLVED OBSOLETE
Product: vala
Classification: Core
Component: Code Generator: GSignal
0.25.x
Other Linux
: Normal normal
: ---
Assigned To: Vala maintainers
Vala maintainers
Depends on:
Blocks:
 
 
Reported: 2014-08-17 02:08 UTC by Michael Catanzaro
Modified: 2018-05-22 15:15 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Michael Catanzaro 2014-08-17 02:08:54 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.
Comment 1 Luca Bruno 2014-08-17 08:05:53 UTC
Vala docs are wrong then, signals are supported also for non-gobject.
Comment 2 GNOME Infrastructure Team 2018-05-22 15:15:22 UTC
-- 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.