`Could not guess unspecified GValue type` on Array and Function types
System information
- GJS 1.80.2
Bug information
Assigning a Function or an Array to a GValue fails
Steps to reproduce
const { GObject, GLib } = imports.gi;
class Var extends GObject.Object {
static {
GObject.registerClass({
Properties: {
'value': GObject.ParamSpec.boxed(
'value', '', '',
GObject.ParamFlags.READWRITE,
GObject.type_from_name('GValue'),
),
},
}, this)
}
get value() { return this._value }
set value(value) { this._value = value }
}
// works
class MyObject extends Object { }
new Var({ value: Object() })
new Var({ value: {} })
new Var({ value: new MyObject() })
new Var({ value: new Var() })
// throws
class MyClass { }
new Var({ value: new MyClass() })
new Var({ value: new Function() })
new Var({ value: function() { } })
new Var({ value: new Array() })
new Var({ value: [] })
Current behaviour
(gjs:203032): Gjs-CRITICAL **: 13:20:14.224: JS ERROR: Error: Could not guess unspecified GValue type
Expected behaviour
They works as expected like with any Object.