[vala/wip/transform: 57/68] dbus: Copy type when declaring temporary	variables
- From: Luca Bruno <lucabru src gnome org>
 
- To: commits-list gnome org
 
- Cc: 
 
- Subject: [vala/wip/transform: 57/68] dbus: Copy type when declaring temporary	variables
 
- Date: Fri,  3 May 2013 20:16:38 +0000 (UTC)
 
commit 5a388fec639a2d6867ce0bd18ac3a289d4c10642
Author: Luca Bruno <lucabru src gnome org>
Date:   Fri Oct 26 13:46:42 2012 +0200
    dbus: Copy type when declaring temporary variables
    
    If type is not copied, then the semantic analyzer will modify the
    original type.
 codegen/valagdbusservertransformer.vala |    2 +-
 tests/dbus/dicts.test                   |   13 +++++++++++++
 2 files changed, 14 insertions(+), 1 deletions(-)
---
diff --git a/codegen/valagdbusservertransformer.vala b/codegen/valagdbusservertransformer.vala
index 9b1ae5a..bdfd631 100644
--- a/codegen/valagdbusservertransformer.vala
+++ b/codegen/valagdbusservertransformer.vala
@@ -106,7 +106,7 @@ public class Vala.GDBusServerTransformer : GDBusClientTransformer {
                b.open_try ();
                string result = null;
                if (m.has_result) {
-                       result = b.add_temp_declaration (m.return_type);
+                       result = b.add_temp_declaration (copy_type (m.return_type));
                        b.add_assignment (expression (result), finish_call);
                } else {
                        b.add_expression (finish_call);
diff --git a/tests/dbus/dicts.test b/tests/dbus/dicts.test
index c67c515..1e7037e 100644
--- a/tests/dbus/dicts.test
+++ b/tests/dbus/dicts.test
@@ -32,6 +32,19 @@ class Test : Object {
        }
 }
 
+namespace TestInterface {
+       [DBus (name = "org.vala.Test.Bar")]
+       public interface Bar : GLib.Object {
+               public abstract HashTable<string, Variant> foo () throws IOError;
+       }
+
+       public class Foo : GLib.DBusProxy, Bar {
+               public HashTable<string, Variant> foo () throws IOError {
+                       return new HashTable<string, Variant> (str_hash, str_equal);
+               }
+       }
+}
+
 MainLoop main_loop;
 
 void client_exit (Pid pid, int status) {
[
Date Prev][
Date Next]   [
Thread Prev][
Thread Next]   
[
Thread Index]
[
Date Index]
[
Author Index]