]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
vala: Write value of constants/enums in fast-vapi if they are constant only 984c034256de3830d6daa0ab6f5eff108dea09bb
authorRico Tzschichholz <ricotz@ubuntu.com>
Tue, 5 Nov 2019 09:07:49 +0000 (10:07 +0100)
committerRico Tzschichholz <ricotz@ubuntu.com>
Tue, 5 Nov 2019 09:11:52 +0000 (10:11 +0100)
Introduced by 89a1243a4f066cc9652b26f86eb94fd038874982

Fixes https://gitlab.gnome.org/GNOME/vala/issues/461

vala/valacodewriter.vala

index 930fbdf2e385a0589de47be869e8214005c31327..2f735e87fd41eedcf1803a31e0bcae281ea45708 100644 (file)
@@ -445,7 +445,7 @@ public class Vala.CodeWriter : CodeVisitor {
                        write_indent ();
                        write_identifier (ev.name);
 
-                       if (type == CodeWriterType.FAST && ev.value != null) {
+                       if (type == CodeWriterType.FAST && ev.value != null && ev.value.is_constant ()) {
                                write_string(" = ");
                                ev.value.accept (this);
                        }
@@ -557,7 +557,7 @@ public class Vala.CodeWriter : CodeVisitor {
                write_string (" ");
                write_identifier (c.name);
                write_type_suffix (c.type_reference);
-               if (type == CodeWriterType.FAST && c.value != null) {
+               if (type == CodeWriterType.FAST && c.value != null && c.value.is_constant ()) {
                        write_string(" = ");
                        c.value.accept (this);
                }