After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 774653 - Erroneously empty output with some constructs
Erroneously empty output with some constructs
Status: RESOLVED FIXED
Product: valadoc
Classification: Other
Component: libvaladoc
git master
Other Linux
: Normal normal
: ---
Assigned To: valadoc-maint
valadoc-maint
Depends on:
Blocks:
 
 
Reported: 2016-11-17 22:29 UTC by Colomban Wendling
Modified: 2017-11-25 19:58 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fix hiding some non-empty namespaces (1.03 KB, patch)
2016-11-17 22:29 UTC, Colomban Wendling
none Details | Review

Description Colomban Wendling 2016-11-17 22:29:14 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.
Comment 1 Colomban Wendling 2016-11-18 12:35:42 UTC
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).
Comment 2 Rico Tzschichholz 2017-11-25 19:58:35 UTC
Requiring gee-0.8 >= 0.19.91 as needed

https://git.gnome.org/browse/valadoc/commit/?id=db5355b978ecda1fe0cf7e7ababe7542fd1bb1ab