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 705014 - Using "parameters" as function parameter name causes DBus code generator to fail
Using "parameters" as function parameter name causes DBus code generator to fail
Status: RESOLVED OBSOLETE
Product: vala
Classification: Core
Component: Code Generator
0.20.x
Other Linux
: Normal minor
: ---
Assigned To: Vala maintainers
Vala maintainers
Depends on:
Blocks:
 
 
Reported: 2013-07-28 09:09 UTC by Marcin Lewandowski
Modified: 2018-05-22 14:55 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Marcin Lewandowski 2013-07-28 09:09:47 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?
Comment 1 GNOME Infrastructure Team 2018-05-22 14:55:17 UTC
-- 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.