]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
Add missing include for enum values, fixes bug 531724
authorJürg Billeter <j@bitron.ch>
Sat, 17 Jan 2009 22:42:25 +0000 (22:42 +0000)
committerJürg Billeter <juergbi@src.gnome.org>
Sat, 17 Jan 2009 22:42:25 +0000 (22:42 +0000)
2009-01-17  Jürg Billeter  <j@bitron.ch>

* vala/valaenumvalue.vala:
* vala/valasourcefile.vala:

Add missing include for enum values, fixes bug 531724

svn path=/trunk/; revision=2381

ChangeLog
vala/valaenumvalue.vala
vala/valasourcefile.vala

index b9801f7d93c12aa7489dfe405b200065e209f14f..89b53f262e8c954b5702805c7cc5dea5acac3266 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2009-01-17  Jürg Billeter  <j@bitron.ch>
+
+       * vala/valaenumvalue.vala:
+       * vala/valasourcefile.vala:
+
+       Add missing include for enum values, fixes bug 531724
+
 2009-01-17  Jürg Billeter  <j@bitron.ch>
 
        * vala/valaconstant.vala:
index 2e9abd2369d1d725f74c5356913ceca2a1a679b2..e77d7af4a45c7d1f803a85fc5fe32286ba364f0d 100644 (file)
@@ -1,6 +1,6 @@
 /* valaenumvalue.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
@@ -140,6 +140,12 @@ public class Vala.EnumValue : Symbol {
 
                if (value != null) {
                        value.check (analyzer);
+
+                       // ensure to include dependency in header file as well if necessary
+                       if (!parent_symbol.is_internal_symbol ()
+                           &&value is MemberAccess && value.symbol_reference != null) {
+                               analyzer.current_source_file.add_symbol_dependency (value.symbol_reference, SourceFileDependencyType.HEADER_SHALLOW);
+                       }
                }
 
                return !error;
index cd511916d4c491c6b26e5468d34355a2f273ef75..51466a68ab1742b8127c2c0d4bcf0653921d6df8 100644 (file)
@@ -1,6 +1,6 @@
 /* valasourcefile.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
@@ -282,7 +282,7 @@ public class Vala.SourceFile {
 
                Symbol s;
                
-               if (sym is ErrorCode) {
+               if (sym is ErrorCode || sym is EnumValue) {
                        s = sym.parent_symbol;
                } else if (sym is TypeSymbol ||
                    sym is Method ||