diff --git a/vlib/v/checker/checker.v b/vlib/v/checker/checker.v index 790380082f..26705ecdc1 100644 --- a/vlib/v/checker/checker.v +++ b/vlib/v/checker/checker.v @@ -24,7 +24,7 @@ const ( valid_comptime_if_compilers = ['gcc', 'tinyc', 'clang', 'mingw', 'msvc', 'cplusplus'] valid_comptime_if_platforms = ['amd64', 'i386', 'aarch64', 'arm64', 'arm32', 'rv64', 'rv32'] valid_comptime_if_cpu_features = ['x64', 'x32', 'little_endian', 'big_endian'] - valid_comptime_if_other = ['js', 'debug', 'prod', 'test', 'glibc', 'prealloc', + valid_comptime_if_other = ['apk', 'js', 'debug', 'prod', 'test', 'glibc', 'prealloc', 'no_bounds_checking', 'freestanding', 'threads', 'js_node', 'js_browser', 'js_freestanding', 'interpreter', 'es5'] valid_comptime_not_user_defined = all_valid_comptime_idents() diff --git a/vlib/v/checker/comptime.v b/vlib/v/checker/comptime.v index dac55459a8..59a5b99d69 100644 --- a/vlib/v/checker/comptime.v +++ b/vlib/v/checker/comptime.v @@ -528,6 +528,7 @@ fn (mut c Checker) comptime_if_branch(cond ast.Expr, pos token.Position) bool { return false } else if cname in valid_comptime_if_other { match cname { + 'apk' { return !c.pref.is_apk } 'js' { return !c.pref.backend.is_js() } 'debug' { return !c.pref.is_debug } 'prod' { return !c.pref.is_prod }