Open gavr123456789 opened 3 years ago
Thanks for reporting.
I just had a short look at the problematic proc:
proc newBuilderListItemFactoryFromBytes*(scope: BuilderScope | BuilderCScope = nil;
bytes: glib.Bytes): BuilderListItemFactory =
let gobj = gtk_builder_list_item_factory_new_from_bytes(if scope.isNil: nil else: cast[ptr BuilderScope00](scope.impl), cast[ptr glib.Bytes00](bytes.impl))
The parameter list looks strange indeed. Do you think it is valid? Is the default nil only applied to BuilderCScope or also to BuilderScope? And does it work at all when first parameter has a default, so is optional, but second parameter is not optional?
I think I have to consult the manual and do a few tests. Will try in the next days...
It is really a funny issue. This one compiles
proc newBuilderListItemFactoryFromBytes*(scope: BuilderScope;# | BuilderCScope;
bytes: glib.Bytes): BuilderListItemFactory =
echo scope.impl == nil
echo bytes.impl == nil
So how can dispatch for or types work when we pass value nil?
Well and you can compile your example with
factory = gtk4.newBuilderListItemFactoryFromBytes(BuilderScope(nil), bytes)
Error on
factory = gtk4.newBuilderListItemFactoryFromBytes(nil, bytes)
line