]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
GAsync: Fix object creation expressions throwing errors
authorJürg Billeter <j@bitron.ch>
Fri, 16 Oct 2009 13:39:20 +0000 (15:39 +0200)
committerJürg Billeter <j@bitron.ch>
Fri, 16 Oct 2009 13:39:20 +0000 (15:39 +0200)
Fixes bug 598677.

codegen/valaccodebasemodule.vala
tests/Makefile.am
tests/asynchronous/bug598677.vala [new file with mode: 0644]

index a4fe54b2280f7b9d63dfa54f1adc8d3e99b6f8ea..b3fbffa98d0290ea3e179cfcf0a78b95ce12457b 100644 (file)
@@ -3777,7 +3777,7 @@ internal class Vala.CCodeBaseModule : CCodeModule {
                        if (expr.tree_can_fail) {
                                // method can fail
                                current_method_inner_error = true;
-                               creation_call.add_argument (new CCodeUnaryExpression (CCodeUnaryOperator.ADDRESS_OF, new CCodeIdentifier ("_inner_error_")));
+                               creation_call.add_argument (new CCodeUnaryExpression (CCodeUnaryOperator.ADDRESS_OF, get_variable_cexpression ("_inner_error_")));
                        }
 
                        if (ellipsis) {
index e9be7e8e9938d4ef430f91212fc51f5da8f81e1c..bb6ac8b1c442acd85091e7d5b2167d1681b160ae 100644 (file)
@@ -63,6 +63,7 @@ TESTS = \
        asynchronous/bug595755.vala \
        asynchronous/bug596177.vala \
        asynchronous/bug597294.vala \
+       asynchronous/bug598677.vala \
        dbus/basic-types.test \
        dbus/arrays.test \
        dbus/async.test \
diff --git a/tests/asynchronous/bug598677.vala b/tests/asynchronous/bug598677.vala
new file mode 100644 (file)
index 0000000..444d6be
--- /dev/null
@@ -0,0 +1,11 @@
+public class Foo {
+       public Foo () throws Error {
+       }
+}
+
+public async void do_foo () throws Error {
+       new Foo ();
+}
+
+void main () {
+}