1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

v.gen.c: do not use precomputed const values in -usecache mode (fix v test-all on M1)

This commit is contained in:
Delyan Angelov 2021-07-20 17:13:01 +03:00
parent 3f5e3c4bfe
commit 24c59881f5

View File

@ -4905,9 +4905,11 @@ fn (mut g Gen) const_decl(node ast.ConstDecl) {
} }
} }
else { else {
if ct_value := field.comptime_expr_value() { if g.pref.build_mode != .build_module {
if g.const_decl_precomputed(field.mod, name, ct_value, field.typ) { if ct_value := field.comptime_expr_value() {
continue if g.const_decl_precomputed(field.mod, name, ct_value, field.typ) {
continue
}
} }
} }
if field.is_simple_define_const() { if field.is_simple_define_const() {