]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
dova: Support list concatenation
authorJürg Billeter <j@bitron.ch>
Sat, 5 Jun 2010 07:56:49 +0000 (09:56 +0200)
committerJürg Billeter <j@bitron.ch>
Sat, 5 Jun 2010 08:12:11 +0000 (10:12 +0200)
vala/valabinaryexpression.vala

index bc4965f35d88548b5ea5214957de63327929f940..ebb19f8a907ebe8ca42ad5bf8976f699ddc98349 100644 (file)
@@ -282,7 +282,16 @@ public class Vala.BinaryExpression : Expression {
                        } else {
                                value_type.value_owned = true;
                        }
-               } else if (left.value_type is ArrayType && operator == BinaryOperator.PLUS) {
+               } else if (analyzer.context.profile == Profile.DOVA && left.value_type.data_type == analyzer.list_type.data_type
+                   && operator == BinaryOperator.PLUS) {
+                       // list concatenation
+
+                       var concat_call = new MethodCall (new MemberAccess (left, "concat"));
+                       concat_call.add_argument (right);
+                       concat_call.target_type = target_type;
+                       parent_node.replace_expression (this, concat_call);
+                       return concat_call.check (analyzer);
+               } else if (analyzer.context.profile != Profile.DOVA && left.value_type is ArrayType && operator == BinaryOperator.PLUS) {
                        // array concatenation
 
                        var array_type = (ArrayType) left.value_type;