GNOME Bugzilla – Bug 774653
Erroneously empty output with some constructs
Last modified: 2017-11-25 19:58:35 UTC
Created attachment 340197 [details] [review] Fix hiding some non-empty namespaces Since https://git.gnome.org/browse/valadoc/commit/?id=77180ba05aa198e4cb9bfd8bc0050f4c5f94e86f the following code produces empty output: private const uint CONSTANT = 0; public class Test.Foo{} Removing the first line fixes the issue. Actually, it is because for some reason `Valadoc.Api.Node.has_visible_children()` returns wrong results, and that again is because `per_type_children.keys.to_array()` returns rubbish: for example it returns `[1, 0]`, while it should actually return `[1, 12]` here (which is what I get manually walking `per_type_children.keys`). I have no idea why this happens (both the code here and Gee's seem to make sense), but the attached patch fixes it for me.
I finally found out why the current code breaks, see https://bugzilla.gnome.org/show_bug.cgi?id=774669 -- it's a bad issue with type size used in the generated C code. I think applying the fix here is a good idea unless you want to wait on the libgee fix and depend on the fixed version (the fix there is *not* perfect, I'm not aware of a perfect fix for this enum-to-array generic code). BTW, this probably won't apply to many 32 bits systems, as the issue arises when sizeof(gpointer) != sizeof(int).
Requiring gee-0.8 >= 0.19.91 as needed https://git.gnome.org/browse/valadoc/commit/?id=db5355b978ecda1fe0cf7e7ababe7542fd1bb1ab