fix issues when using non-null types
authorJuerg Billeter <j@bitron.ch>
Sun, 13 Apr 2008 18:24:20 +0000 (18:24 +0000)
committerJürg Billeter <juergbi@src.gnome.org>
Sun, 13 Apr 2008 18:24:20 +0000 (18:24 +0000)
2008-04-13  Juerg Billeter  <j@bitron.ch>

* vala/valasemanticanalyzer.vala, vala/valasymbolresolver.vala:
  fix issues when using non-null types

svn path=/trunk/; revision=1210

ChangeLog
vala/valasemanticanalyzer.vala
vala/valasymbolresolver.vala

index f0a43ea..9774655 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2008-04-13  Jürg Billeter  <j@bitron.ch>
 
+       * vala/valasemanticanalyzer.vala, vala/valasymbolresolver.vala:
+         fix issues when using non-null types
+
+2008-04-13  Jürg Billeter  <j@bitron.ch>
+
        * vala/valaparser.vala: deprecate construct as parameter modifier,
          fixes bug 524138
 
index c863553..54cb3f8 100644 (file)
@@ -1059,12 +1059,12 @@ public class Vala.SemanticAnalyzer : CodeVisitor {
                        var array_type = (ArrayType) collection_type;
                        element_data_type = array_type.element_type;
                        need_type_check = true;
-               } else if (collection_type.compatible (glist_type) || collection_type.compatible (gslist_type)) {               
+               } else if (collection_type.compatible (glist_type, false) || collection_type.compatible (gslist_type, false)) {         
                        if (collection_type.get_type_arguments ().size > 0) {
                                element_data_type = (DataType) collection_type.get_type_arguments ().get (0);
                                need_type_check = true;
                        }
-               } else if (iterable_type != null && collection_type.compatible (iterable_type)) {
+               } else if (iterable_type != null && collection_type.compatible (iterable_type, false)) {
                        stmt.iterator_variable_declarator = new VariableDeclarator ("%s_it".printf (stmt.variable_name));
                        stmt.iterator_variable_declarator.type_reference = new InterfaceType (iterator_type);
                        stmt.iterator_variable_declarator.type_reference.takes_ownership = true;
index 6749dc0..b71afd9 100644 (file)
@@ -305,6 +305,8 @@ public class Vala.SymbolResolver : CodeVisitor {
                        element_type.transfers_ownership = false;
                        element_type.is_ref = false;
                        element_type.is_out = false;
+                       element_type.nullable = false;
+                       element_type.requires_null_check = false;
 
                        type = new ArrayType (element_type, unresolved_type.array_rank, unresolved_type.source_reference);
                        type.add_type_argument (element_type);