hugopl/gi-crystal

Subclass type name contains invalid characters

BlobCodes opened this issue · 1 comments

While testing out GObject subclasses, I rather quickly got this error:

(process:29558): GLib-GObject-WARNING **: 15:40:37.670: type name 'Test::Object' contains invalid characters

(process:29558): GLib-CRITICAL **: 15:40:37.670: g_once_init_leave: assertion 'result != 0' failed

(process:29558): GLib-GObject-CRITICAL **: 15:40:37.670: g_object_newv: assertion 'G_TYPE_IS_OBJECT (object_type)' failed

(process:29558): GLib-GObject-CRITICAL **: 15:40:37.670: g_object_is_floating: assertion 'G_IS_OBJECT (object)' failed

(process:29558): GLib-GObject-CRITICAL **: 15:40:37.670: g_object_set_qdata: assertion 'G_IS_OBJECT (object)' failed

Code:

require "gtk4"

class Test::Object < GObject::Object
end

Test::Object.new

I assume colons are not allowed in GObject type names and need to be filtered out.

Closed by #30