aboutsummaryrefslogtreecommitdiff
path: root/src/analyze.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/analyze.cpp')
-rw-r--r--src/analyze.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/analyze.cpp b/src/analyze.cpp
index d048dd9770..85e390f2e0 100644
--- a/src/analyze.cpp
+++ b/src/analyze.cpp
@@ -4512,6 +4512,8 @@ bool fn_eval_cacheable(Scope *scope, ZigType *return_type) {
ScopeVarDecl *var_scope = (ScopeVarDecl *)scope;
if (type_is_invalid(var_scope->var->var_type))
return false;
+ if (var_scope->var->const_value->special == ConstValSpecialUndef)
+ return false;
if (can_mutate_comptime_var_state(var_scope->var->const_value))
return false;
} else if (scope->id == ScopeIdFnDef) {