summaryrefslogtreecommitdiff
path: root/vala/valaconstant.vala
diff options
context:
space:
mode:
authorRico Tzschichholz <ricotz@ubuntu.com>2019-11-14 21:04:42 +0100
committerRico Tzschichholz <ricotz@ubuntu.com>2019-11-15 08:25:33 +0100
commit5bf84028dba1e3f9d4be590b0646afeb9dfa3d7f (patch)
tree8f1d44222d854874e3c32dc3327d7d7d216eceed /vala/valaconstant.vala
parent9ca70b497043d2c386bdd35ff188264d76d13556 (diff)
downloadvala-5bf84028dba1e3f9d4be590b0646afeb9dfa3d7f.tar.gz
vala: Don't require constant initializer in fast-vapi
Regression of 984c034256de3830d6daa0ab6f5eff108dea09bb Extend --fast-vapi test by using --use-fast-vapi See https://github.com/dino/dino/issues/646 and https://gitlab.gnome.org/GNOME/vala/issues/461
Diffstat (limited to 'vala/valaconstant.vala')
-rw-r--r--vala/valaconstant.vala7
1 files changed, 5 insertions, 2 deletions
diff --git a/vala/valaconstant.vala b/vala/valaconstant.vala
index 519d43b1b..3ff4bf3c4 100644
--- a/vala/valaconstant.vala
+++ b/vala/valaconstant.vala
@@ -123,8 +123,11 @@ public class Vala.Constant : Symbol {
if (!external) {
if (value == null) {
- error = true;
- Report.error (source_reference, "A const field requires a value to be provided");
+ // constants from fast-vapi files are special
+ if (source_type != SourceFileType.FAST) {
+ error = true;
+ Report.error (source_reference, "A const field requires a value to be provided");
+ }
} else {
value.target_type = type_reference;