summaryrefslogtreecommitdiff
path: root/vala
diff options
context:
space:
mode:
authorJürg Billeter <j@bitron.ch>2010-03-13 21:49:39 +0100
committerJürg Billeter <j@bitron.ch>2010-03-13 21:49:39 +0100
commitc465f8909c5957035191f5c34ab876219281c0d9 (patch)
tree071bd5973f27c6dad22e15a33edb2a6399d6c8fb /vala
parent6cb86f046f334eb092358ac0ba23e450a9845ed3 (diff)
downloadvala-c465f8909c5957035191f5c34ab876219281c0d9.tar.gz
dova: Do not support foreach without iterator
Diffstat (limited to 'vala')
-rw-r--r--vala/valaforeachstatement.vala6
1 files changed, 3 insertions, 3 deletions
diff --git a/vala/valaforeachstatement.vala b/vala/valaforeachstatement.vala
index 401e43aa2..0de1cb8f7 100644
--- a/vala/valaforeachstatement.vala
+++ b/vala/valaforeachstatement.vala
@@ -167,14 +167,14 @@ public class Vala.ForeachStatement : Block {
var collection_type = collection.value_type.copy ();
collection.target_type = collection_type.copy ();
- if (collection_type.is_array ()) {
+ if (analyzer.context.profile != Profile.DOVA && collection_type.is_array ()) {
var array_type = (ArrayType) collection_type;
// can't use inline-allocated array for temporary variable
array_type.inline_allocated = false;
return check_without_iterator (analyzer, collection_type, array_type.element_type);
- } else if (collection_type.compatible (analyzer.glist_type) || collection_type.compatible (analyzer.gslist_type)) {
+ } else if (analyzer.context.profile == Profile.GOBJECT && (collection_type.compatible (analyzer.glist_type) || collection_type.compatible (analyzer.gslist_type))) {
if (collection_type.get_type_arguments ().size != 1) {
error = true;
Report.error (collection.source_reference, "missing type argument for collection");
@@ -182,7 +182,7 @@ public class Vala.ForeachStatement : Block {
}
return check_without_iterator (analyzer, collection_type, collection_type.get_type_arguments ().get (0));
- } else if (collection_type.compatible (analyzer.gvaluearray_type)) {
+ } else if (analyzer.context.profile == Profile.GOBJECT && collection_type.compatible (analyzer.gvaluearray_type)) {
return check_without_iterator (analyzer, collection_type, analyzer.gvalue_type);
} else {
return check_with_iterator (analyzer, collection_type);