summaryrefslogtreecommitdiff
path: root/vala
diff options
context:
space:
mode:
authorJürg Billeter <j@bitron.ch>2009-09-18 12:49:34 +0200
committerJürg Billeter <j@bitron.ch>2009-09-18 12:49:34 +0200
commitf3f62d0591f6b77851b3a243e867f1df91cb899b (patch)
tree4abb20f44484ad77750d5e014d406e1e0951a552 /vala
parent2e831744dcaac0d76f7ff89bfd13a1ba5dd951d7 (diff)
downloadvala-f3f62d0591f6b77851b3a243e867f1df91cb899b.tar.gz
Fix methods returning owned delegates
Diffstat (limited to 'vala')
-rw-r--r--vala/valadelegatetype.vala13
-rw-r--r--vala/valaexpression.vala3
-rw-r--r--vala/valalambdaexpression.vala1
3 files changed, 14 insertions, 3 deletions
diff --git a/vala/valadelegatetype.vala b/vala/valadelegatetype.vala
index 40035d9f7..1f32a7e5d 100644
--- a/vala/valadelegatetype.vala
+++ b/vala/valadelegatetype.vala
@@ -1,6 +1,6 @@
/* valadelegatetype.vala
*
- * Copyright (C) 2007-2008 Jürg Billeter
+ * Copyright (C) 2007-2009 Jürg Billeter
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -54,7 +54,16 @@ public class Vala.DelegateType : DataType {
}
public override DataType copy () {
- return new DelegateType (delegate_symbol);
+ var result = new DelegateType (delegate_symbol);
+ result.source_reference = source_reference;
+ result.value_owned = value_owned;
+ result.nullable = nullable;
+
+ foreach (DataType arg in get_type_arguments ()) {
+ result.add_type_argument (arg.copy ());
+ }
+
+ return result;
}
public override string? get_cname () {
diff --git a/vala/valaexpression.vala b/vala/valaexpression.vala
index 431349972..a97ed102e 100644
--- a/vala/valaexpression.vala
+++ b/vala/valaexpression.vala
@@ -66,7 +66,8 @@ public abstract class Vala.Expression : CodeNode {
private Gee.List<CCodeExpression> array_sizes = new ArrayList<CCodeExpression> ();
- public CCodeExpression delegate_target { get; set; }
+ public CCodeExpression? delegate_target { get; set; }
+ public CCodeExpression? delegate_target_destroy_notify { get; set; }
/**
* Returns whether this expression is constant, i.e. whether this
diff --git a/vala/valalambdaexpression.vala b/vala/valalambdaexpression.vala
index 16a51c1c3..c9794c2ad 100644
--- a/vala/valalambdaexpression.vala
+++ b/vala/valalambdaexpression.vala
@@ -223,6 +223,7 @@ public class Vala.LambdaExpression : Expression {
}
value_type = new MethodType (method);
+ value_type.value_owned = target_type.value_owned;
return !error;
}