]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
Fix symbol lookup in constant and field initializers, fixes bug 567760
authorJürg Billeter <j@bitron.ch>
Sat, 17 Jan 2009 22:29:47 +0000 (22:29 +0000)
committerJürg Billeter <juergbi@src.gnome.org>
Sat, 17 Jan 2009 22:29:47 +0000 (22:29 +0000)
2009-01-17  Jürg Billeter  <j@bitron.ch>

* vala/valaconstant.vala:
* vala/valafield.vala:

Fix symbol lookup in constant and field initializers,
fixes bug 567760

svn path=/trunk/; revision=2380

ChangeLog
vala/valaconstant.vala
vala/valafield.vala

index 07a22c5f026ae3e1853a3f413d129abb4aba6cf2..b9801f7d93c12aa7489dfe405b200065e209f14f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2009-01-17  Jürg Billeter  <j@bitron.ch>
+
+       * vala/valaconstant.vala:
+       * vala/valafield.vala:
+
+       Fix symbol lookup in constant and field initializers,
+       fixes bug 567760
+
 2009-01-17  Jürg Billeter  <j@bitron.ch>
 
        * gobject/valaccodedelegatemodule.vala:
index 555531e29b02ef68d93d3702d8a19dfe85673d58..d8fc272dfa229ee75737fffc700c9d96e43ffd45 100644 (file)
@@ -1,6 +1,6 @@
 /* valaconstant.vala
  *
- * Copyright (C) 2006-2008  Jürg Billeter
+ * Copyright (C) 2006-2009  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
@@ -160,6 +160,14 @@ public class Vala.Constant : Member, Lockable {
 
                process_attributes ();
 
+               var old_source_file = analyzer.current_source_file;
+               var old_symbol = analyzer.current_symbol;
+
+               if (source_reference != null) {
+                       analyzer.current_source_file = source_reference.file;
+               }
+               analyzer.current_symbol = this;
+
                type_reference.check (analyzer);
 
                if (!external_package) {
@@ -173,6 +181,9 @@ public class Vala.Constant : Member, Lockable {
                        }
                }
 
+               analyzer.current_source_file = old_source_file;
+               analyzer.current_symbol = old_symbol;
+
                return !error;
        }
 }
index 61ed7d33a50cf8265561c48a337f8c7015d4bc3e..d24491e8bb2f41fd31120af8b9a046099fbfa048 100644 (file)
@@ -282,10 +282,12 @@ public class Vala.Field : Member, Lockable {
                checked = true;
 
                var old_source_file = analyzer.current_source_file;
+               var old_symbol = analyzer.current_symbol;
 
                if (source_reference != null) {
                        analyzer.current_source_file = source_reference.file;
                }
+               analyzer.current_symbol = this;
 
                field_type.check (analyzer);
 
@@ -330,6 +332,7 @@ public class Vala.Field : Member, Lockable {
                }
 
                analyzer.current_source_file = old_source_file;
+               analyzer.current_symbol = old_symbol;
 
                return !error;
        }