[vala/wip/array-length-type] codegen: Infer index type of foreach on array from ArrayType.length_type
- From: Rico Tzschichholz <ricotz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/wip/array-length-type] codegen: Infer index type of foreach on array from ArrayType.length_type
- Date: Thu, 1 Nov 2018 07:43:42 +0000 (UTC)
commit 043f0f1c3fa9e7823fccbda022576cdc656ed010
Author: George Barrett <bob bob131 so>
Date: Tue Dec 12 14:39:33 2017 +1100
codegen: Infer index type of foreach on array from ArrayType.length_type
https://gitlab.gnome.org/GNOME/vala/issues/607
codegen/valaccodecontrolflowmodule.vala | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/codegen/valaccodecontrolflowmodule.vala b/codegen/valaccodecontrolflowmodule.vala
index 1936d512d..58e51d99f 100644
--- a/codegen/valaccodecontrolflowmodule.vala
+++ b/codegen/valaccodecontrolflowmodule.vala
@@ -247,7 +247,7 @@ public abstract class Vala.CCodeControlFlowModule : CCodeMethodModule {
// store array length for use by _vala_array_free
ccode.add_assignment (get_variable_cexpression (get_array_length_cname
(get_local_cname (collection_backup), 1)), array_len);
- var iterator_variable = new LocalVariable (int_type.copy (), stmt.variable_name +
"_it");
+ var iterator_variable = new LocalVariable (array_type.length_type.copy (),
stmt.variable_name + "_it");
visit_local_variable (iterator_variable);
var it_name = get_local_cname (iterator_variable);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]