]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
Do not depend on declaration order for constants
authorJürg Billeter <j@bitron.ch>
Sat, 5 Jun 2010 12:07:23 +0000 (14:07 +0200)
committerJürg Billeter <j@bitron.ch>
Sat, 5 Jun 2010 12:07:23 +0000 (14:07 +0200)
Fixes bug 618890.

codegen/valaccodememberaccessmodule.vala

index f21113ea5cc48534e5791c5ee271090b48370d83..6143a4ffe0ab479223e758d1b5b71862dc7ea79b 100644 (file)
@@ -175,7 +175,9 @@ public class Vala.CCodeMemberAccessModule : CCodeControlFlowModule {
                } else if (expr.symbol_reference is Constant) {
                        var c = (Constant) expr.symbol_reference;
 
-                       generate_constant_declaration (c, source_declarations);
+                       generate_constant_declaration (c, source_declarations,
+                               c.source_reference != null && expr.source_reference != null &&
+                               c.source_reference.file == expr.source_reference.file);
 
                        string fn = c.get_full_name ();
                        if (fn == "GLib.Log.FILE") {