diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2019-06-21 17:49:54 -0400 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2019-06-21 17:49:54 -0400 |
| commit | ff6d563b0455aea51775e6906f5e7f0dd67b7127 (patch) | |
| tree | 46eb0b20c729ee623bbc4f6f8b965c09c9c8a1b3 /src/analyze.cpp | |
| parent | 5441f7767237709e8f3c05c2dc75070e835b4024 (diff) | |
| download | zig-ff6d563b0455aea51775e6906f5e7f0dd67b7127.tar.gz zig-ff6d563b0455aea51775e6906f5e7f0dd67b7127.zip | |
fix implicit cast to optional to error union to return result loc
Diffstat (limited to 'src/analyze.cpp')
| -rw-r--r-- | src/analyze.cpp | 2 |
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) { |
