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 586484 - valac should throw an error on unusable names
valac should throw an error on unusable names
Status: RESOLVED DUPLICATE of bug 472259
Product: vala
Classification: Core
Component: Errors
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Jürg Billeter
Vala maintainers
Depends on:
Blocks:
 
 
Reported: 2009-06-20 18:10 UTC by zarevucky.jiri
Modified: 2009-07-29 06:22 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description zarevucky.jiri 2009-06-20 18:10:26 UTC
Due to the way valac generates code, it is not possible to use certain names.

For example, you can't define a "type" property, or a "get_type ()" method. Similarly, you can't simultaneously define property "property" and methods "get_property"/"set_property".

Doing so will result in a not-very-clear GCC error. valac should instead check these cases and itself present a descriptive error.
Comment 1 Daniel Svensson 2009-07-28 23:07:36 UTC
This also happens when defining a method with the following signature:

public static bool transform_duration (Xmms.Value val, out string result)

Here the result parameter seems to be a reserved word and it results in a gcc warning:

build/src/client.c: In function 'abraca_client_transform_duration':
build/src/client.c:877: warning: comparison between pointer and integer

Here is the generated code:

gboolean abraca_client_transform_value (xmmsv_t* value, const char* key, char** _result_) {
  gboolean result;
  ... 
  if (result != NULL) {
    *_result_ = NULL;
  }
  ...
}
Comment 2 Jürg Billeter 2009-07-29 06:22:18 UTC
commit ee05242952c5f448e504ddb36e3bd3b3962aefae
Author: Jürg Billeter <j@bitron.ch>
Date:   Wed Jul 29 08:18:39 2009 +0200

    Fix name mangling in NULL check for out parameters
Comment 3 Jürg Billeter 2009-07-29 06:22:34 UTC
Thanks for the bug report. This particular bug has already been reported into our bug tracking system, but please feel free to report any further bugs you find.


*** This bug has been marked as a duplicate of 472259 ***