TL;DR: tapioca dsl misses modules created for GObject interfaces, and maybe other types, too.
Cause
gobject-introspection is a gem brigding to GObject APIs.
For example, GObject interfaces get modelled via Ruby Modules, created here, and set via const_set here. Every such interface will have its const_source_location point to gobject-introspection/lib/gobject-introspection/loader.rb#L618.
When other gems (like gio2) import GObject interfaces, their const_source_location will always point to gobject-introspection/lib/gobject-introspection/loader.rb#L618. Since this location is outside the gem (and in gobject-introspection), Tapioca will skip those module, because it's not defined_in_gem?:
|
#: (String name, Module[top] constant) -> bool |
|
def skip_module?(name, constant) |
|
return true unless defined_in_gem?(constant, strict: false) |
|
return true if Tapioca::TypeVariableModule === constant |
|
|
|
false |
|
end |
As a result, the generated gio2.rbi will be missing some interface declaration. It will still include lines that rely on them, leading to type errors.
TL;DR:
tapioca dslmisses modules created for GObject interfaces, and maybe other types, too.Cause
gobject-introspectionis a gem brigding to GObject APIs.For example, GObject interfaces get modelled via Ruby
Modules, created here, and set viaconst_sethere. Every such interface will have itsconst_source_locationpoint togobject-introspection/lib/gobject-introspection/loader.rb#L618.When other gems (like
gio2) import GObject interfaces, theirconst_source_locationwill always point togobject-introspection/lib/gobject-introspection/loader.rb#L618. Since this location is outside the gem (and ingobject-introspection), Tapioca will skip those module, because it's notdefined_in_gem?:tapioca/lib/tapioca/gem/pipeline.rb
Lines 449 to 455 in b8161b8
As a result, the generated
gio2.rbiwill be missing some interface declaration. It will stillincludelines that rely on them, leading to type errors.