From: Jürg Billeter Date: Sat, 17 Jan 2009 22:29:47 +0000 (+0000) Subject: Fix symbol lookup in constant and field initializers, fixes bug 567760 X-Git-Tag: VALA_0_5_6~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b8bb605f8543ebf9b8003f99aa90379d4bd0b7e8;p=thirdparty%2Fvala.git Fix symbol lookup in constant and field initializers, fixes bug 567760 2009-01-17 Jürg Billeter * vala/valaconstant.vala: * vala/valafield.vala: Fix symbol lookup in constant and field initializers, fixes bug 567760 svn path=/trunk/; revision=2380 --- diff --git a/ChangeLog b/ChangeLog index 07a22c5f0..b9801f7d9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2009-01-17 Jürg Billeter + + * vala/valaconstant.vala: + * vala/valafield.vala: + + Fix symbol lookup in constant and field initializers, + fixes bug 567760 + 2009-01-17 Jürg Billeter * gobject/valaccodedelegatemodule.vala: diff --git a/vala/valaconstant.vala b/vala/valaconstant.vala index 555531e29..d8fc272df 100644 --- a/vala/valaconstant.vala +++ b/vala/valaconstant.vala @@ -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; } } diff --git a/vala/valafield.vala b/vala/valafield.vala index 61ed7d33a..d24491e8b 100644 --- a/vala/valafield.vala +++ b/vala/valafield.vala @@ -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; }