fix error handling with unknown namespaces
authorJürg Billeter <j@bitron.ch>
Mon, 26 Feb 2007 22:41:02 +0000 (22:41 +0000)
committerJürg Billeter <juergbi@src.gnome.org>
Mon, 26 Feb 2007 22:41:02 +0000 (22:41 +0000)
2007-02-26  Jürg Billeter  <j@bitron.ch>

* vala/valasymbolresolver.vala: fix error handling with unknown
  namespaces

svn path=/trunk/; revision=201

vala/ChangeLog
vala/vala/valasymbolresolver.vala

index c3aa507..1f94e5c 100644 (file)
@@ -1,5 +1,10 @@
 2007-02-26  Jürg Billeter  <j@bitron.ch>
 
+       * vala/valasymbolresolver.vala: fix error handling with unknown
+         namespaces
+
+2007-02-26  Jürg Billeter  <j@bitron.ch>
+
        * tests/test-028.vala, tests/test-028.out: test enums
        * tests/Makefile.am: update
 
index aaddb31..ec70182 100644 (file)
@@ -128,6 +128,7 @@ public class Vala.SymbolResolver : CodeVisitor {
        public override void visit_namespace_reference (NamespaceReference! ns) {
                ns.namespace_symbol = current_scope.lookup (ns.name);
                if (ns.namespace_symbol == null) {
+                       ns.error = true;
                        Report.error (ns.source_reference, "The namespace name `%s' could not be found".printf (ns.name));
                        return;
                }
@@ -151,6 +152,10 @@ public class Vala.SymbolResolver : CodeVisitor {
                        }
                        if (sym == null) {
                                foreach (NamespaceReference ns in current_using_directives) {
+                                       if (ns.error) {
+                                               continue;
+                                       }
+
                                        var local_sym = ns.namespace_symbol.lookup (type.type_name);
                                        if (local_sym != null) {
                                                if (sym != null) {
@@ -173,6 +178,7 @@ public class Vala.SymbolResolver : CodeVisitor {
                } else {
                        var ns_symbol = root_symbol.lookup (type.namespace_name);
                        if (ns_symbol == null) {
+                               type.error = true;
                                Report.error (type.source_reference, "The namespace name `%s' could not be found".printf (type.namespace_name));
                                return;
                        }