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 670167 - GIR parser doesn't honor "Rename to:" annotation
GIR parser doesn't honor "Rename to:" annotation
Status: RESOLVED NOTABUG
Product: vala
Classification: Core
Component: GObject Introspection
0.15.x
Other Linux
: Normal normal
: ---
Assigned To: Vala maintainers
Vala maintainers
Depends on:
Blocks:
 
 
Reported: 2012-02-15 20:52 UTC by Daniel Espinosa
Modified: 2015-02-08 23:44 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Daniel Espinosa 2012-02-15 20:52:42 UTC
In GDA we have two functions:

Gda.MetaStore.extract (with introspectable="0" and shadowed-by="extract_v" in GIR)

and

Gda.MetaStore.extract_v (with shadows="extract")

Generated VAPI hides Gda.MetaStore.extract but not renames extract_v as expected. This happends in Python, you can use extract but not extract_v.
Comment 1 Evan Nemerson 2012-06-19 23:54:03 UTC
I'm a bit uneasy about this.  If Gda.MetaStore.extract is a variadic function (which would be my guess based on your description), Vala should be able to handle it so there is no need to skip it.  Unfortunately G-I doesn't provide a way to say that the reason something is marked as introspectable="0" is because of the variadic arguments, but if that is the case we would usually use metadata to un-skip that method.
Comment 2 Colomban Wendling 2015-02-08 23:31:12 UTC
valac still doesn't honor `shadows` (which is called "rename-to" in GI annotations) as expected as of 0.26.1.

It's problematic for me, because I'm trying to use these to provide a more sensible API for higher level languages (those that use GIR), by hiding APIs using custom things in favor of (slightly slower but) more fitted APIs using things like GValue/GVariant, plain GIO streams and the like.

I know, I could change the C API to use those directly -- and in some cases it would be as good for C too -- but it would mean breaking C API while GIR has a nice feature to do just what I need.
Comment 3 Evan Nemerson 2015-02-08 23:44:09 UTC
You can use a metadata file to move stuff around for Vala bindings, or people can use the other names like they would in C.

Most of the time when people use "rename to" it is to replace an API which simply doesn't work in G-I, but usually those do work in Vala, so honoring "rename to" isn't a great solution.

Even if we wanted to (which I am against), at this point it would be a terrible API break, so it's not going to happen.

Sorry, I know some people will be inconvenienced by this, but I think it is, by far, the lesser of two evils.