GNOME Bugzilla – Bug 586484
valac should throw an error on unusable names
Last modified: 2009-07-29 06:22:34 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.
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; } ... }
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
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 ***