summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJürg Billeter <j@bitron.ch>2013-04-27 17:31:02 +0200
committerJürg Billeter <j@bitron.ch>2013-05-21 06:33:37 +0200
commitd1145ab86d6eb11fab5d9d813300b57812b2ba18 (patch)
tree4361bc17d5810ba78ab037a9b5e6257c965060e6
parentb9427c00ae04c0ca4b91526614411c59904df16c (diff)
downloadvala-d1145ab86d6eb11fab5d9d813300b57812b2ba18.tar.gz
Set target_type for start and stop values of slice expressions
This ensures type conversions are generated as needed. Fixes bug 698997.
-rw-r--r--vala/valasliceexpression.vala7
1 files changed, 6 insertions, 1 deletions
diff --git a/vala/valasliceexpression.vala b/vala/valasliceexpression.vala
index 7b741a340..5b1675be8 100644
--- a/vala/valasliceexpression.vala
+++ b/vala/valasliceexpression.vala
@@ -1,7 +1,7 @@
/* valasliceexpression.vala
*
* Copyright (C) 2009 Robin Sonefors
- * Copyright (C) 2009-2010 Jürg Billeter
+ * Copyright (C) 2009-2013 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
@@ -110,6 +110,11 @@ public class Vala.SliceExpression : Expression {
return false;
}
+ if (container.value_type is ArrayType) {
+ start.target_type = context.analyzer.int_type.copy ();
+ stop.target_type = context.analyzer.int_type.copy ();
+ }
+
if (!start.check (context)) {
error = true;
return false;