Skip to content

Commit

Permalink
vala: Write value of constants/enums in fast-vapi if they are constan…
Browse files Browse the repository at this point in the history
  • Loading branch information
ricotz committed Nov 5, 2019
1 parent d14248f commit 984c034
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions vala/valacodewriter.vala
Expand Up @@ -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);
}
Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit 984c034

Please sign in to comment.