summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJürg Billeter <j@bitron.ch>2008-10-17 13:35:56 +0000
committerJürg Billeter <juergbi@src.gnome.org>2008-10-17 13:35:56 +0000
commit5353f662c60b37d43bfb26d5b5484f0199735325 (patch)
tree905a819d10c5db72eb3516bf5a54d59765f44bae
parente0892213b07b8c581ae85190c92984f4a6e7facc (diff)
downloadvala-5353f662c60b37d43bfb26d5b5484f0199735325.tar.gz
Ignore non-type symbols when resolving types
2008-10-17 Jürg Billeter <j@bitron.ch> * vala/valasymbolresolver.vala: Ignore non-type symbols when resolving types svn path=/trunk/; revision=1853
-rw-r--r--ChangeLog6
-rw-r--r--vala/valasymbolresolver.vala12
2 files changed, 18 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index f7bef5378..ff84a2747 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
2008-10-17 Jürg Billeter <j@bitron.ch>
+ * vala/valasymbolresolver.vala:
+
+ Ignore non-type symbols when resolving types
+
+2008-10-17 Jürg Billeter <j@bitron.ch>
+
* vala/valaenumvalue.vala:
* vala/valainterfacewriter.vala:
diff --git a/vala/valasymbolresolver.vala b/vala/valasymbolresolver.vala
index 58a8e0733..cdaa096a3 100644
--- a/vala/valasymbolresolver.vala
+++ b/vala/valasymbolresolver.vala
@@ -200,6 +200,12 @@ public class Vala.SymbolResolver : CodeVisitor {
Scope scope = current_scope;
while (sym == null && scope != null) {
sym = scope.lookup (unresolved_symbol.name);
+
+ // only look for types and type containers
+ if (!(sym is Namespace || sym is TypeSymbol || sym is TypeParameter)) {
+ sym = null;
+ }
+
scope = scope.parent_scope;
}
if (sym == null) {
@@ -209,6 +215,12 @@ public class Vala.SymbolResolver : CodeVisitor {
}
var local_sym = ns.namespace_symbol.scope.lookup (unresolved_symbol.name);
+
+ // only look for types and type containers
+ if (!(local_sym is Namespace || local_sym is TypeSymbol || sym is TypeParameter)) {
+ local_sym = null;
+ }
+
if (local_sym != null) {
if (sym != null) {
unresolved_symbol.error = true;