[vala/staging] FIX Foreach array



commit 0645238999259954fe176da10fa8b72ee1b7a2b3
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Wed Apr 1 20:05:19 2020 +0200

    FIX Foreach array

 codegen/valaccodetransformer.vala | 2 +-
 vala/valaforeachstatement.vala    | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/codegen/valaccodetransformer.vala b/codegen/valaccodetransformer.vala
index ad348df1a..f1d9f64ad 100644
--- a/codegen/valaccodetransformer.vala
+++ b/codegen/valaccodetransformer.vala
@@ -130,7 +130,7 @@ public class Vala.CCodeTransformer : CodeTransformer {
        public override void visit_foreach_statement (ForeachStatement stmt) {
                begin_replace_statement (stmt);
 
-               var collection = b.add_temp_declaration (stmt.collection.value_type, stmt.collection);
+               var collection = b.add_temp_declaration (stmt.collection.target_type, stmt.collection);
 
                stmt.body.remove_local_variable (stmt.element_variable);
                stmt.element_variable.checked = false;
diff --git a/vala/valaforeachstatement.vala b/vala/valaforeachstatement.vala
index 6b94bfbed..03e98b608 100644
--- a/vala/valaforeachstatement.vala
+++ b/vala/valaforeachstatement.vala
@@ -149,7 +149,7 @@ public class Vala.ForeachStatement : BaseStatement {
                }
 
                var collection_type = collection.value_type.copy ();
-               collection.target_type = collection_type.copy ();
+               collection.target_type = collection_type;
 
                if (collection_type is ArrayType) {
                        var array_type = (ArrayType) collection_type;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]