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 645528 - GDBus: Impossible to emit a a{sas} D-Bus signal easily
GDBus: Impossible to emit a a{sas} D-Bus signal easily
Status: RESOLVED FIXED
Product: vala
Classification: Core
Component: D-Bus
0.11.x
Other Linux
: Normal normal
: ---
Assigned To: Vala maintainers
Vala maintainers
Depends on:
Blocks:
 
 
Reported: 2011-03-22 14:32 UTC by Alban Crequy
Modified: 2011-03-22 20:41 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
test_signal.vala (1.63 KB, text/x-vala)
2011-03-22 14:32 UTC, Alban Crequy
Details

Description Alban Crequy 2011-03-22 14:32:29 UTC
Created attachment 184068 [details]
test_signal.vala

valac 0.11.7.7-6929

I cannot declare a variable of type HashTable<string,string[]?> because I get the error:

error: `string[]?' is not a supported generic type argument, use `?' to box value types

I tried without success several syntaxes: with or without the "?", with GStrv.

According to juergbi, it is not supported in a native type. Emitting D-Bus signal are difficult because I have to build the variants manually and use:
conn.emit_signal ("bus.name", "/path", "iface", "signalName", variant)

Using [DBus (signature = "a{sas}")] does not work neither because I get an critical error:

(process:32429): GLib-CRITICAL **: g_variant_builder_add_value: assertion `!GVSB(builder)->expected_type || g_variant_is_of_type (value, GVSB(builder)->expected_type)' failed

The attached program illustrates the problem.
Comment 1 Jürg Billeter 2011-03-22 20:41:09 UTC
commit b3e19eba39e882ac42cbd69fb48b361186ea2636
Author: Jürg Billeter <j@bitron.ch>
Date:   Tue Mar 22 21:39:23 2011 +0100

    D-Bus: Support DBus.signature attribute for struct fields
    
    Fixes bug 645528.