GNOME Bugzilla – Bug 705014
Using "parameters" as function parameter name causes DBus code generator to fail
Last modified: 2018-05-22 14:55:17 UTC
I use vala 0.20.1. I've created function with following syntax: public void do_something(MyEnum type, string subtype, string identifier, HashTable<string,string> parameters) throws MyError It is exported over DBus. C compiler breaks the compilation with error "error: ‘parameters’ redeclared as different kind of symbol" Underlying C code has function static void _dbus_mynamespace_do_something (MyClass* self, GVariant* parameters, GDBusMethodInvocation* invocation) { (...) GHashTable* parameters = NULL; (...) } So indeed, parameters becomes redeclared. If "parameters" is a reserved keyword for any reason IMO valac should catch it and return nice message, or maybe in such internal funcs variable names should be something less obvious?
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/vala/issues/399.