diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2018-07-25 17:08:55 -0400 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2018-07-25 17:08:55 -0400 |
| commit | 84195467ad974f9b7201e4e1bbd6dccbd5e7ab90 (patch) | |
| tree | 4f7f0a4c239b5fbbd85bb6be5588db8179898802 /src | |
| parent | 2257660916a8c92d953a5a71da6c2d4f7cc031e6 (diff) | |
| download | zig-84195467ad974f9b7201e4e1bbd6dccbd5e7ab90.tar.gz zig-84195467ad974f9b7201e4e1bbd6dccbd5e7ab90.zip | |
add compile error for non-inline for loop on comptime type
Diffstat (limited to 'src')
| -rw-r--r-- | src/ir.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/ir.cpp b/src/ir.cpp index fd2558c5eb..424987823b 100644 --- a/src/ir.cpp +++ b/src/ir.cpp @@ -12142,7 +12142,7 @@ static TypeTableEntry *ir_analyze_instruction_decl_var(IrAnalyze *ira, IrInstruc result_type = ira->codegen->builtin_types.entry_invalid; } else if (type_requires_comptime(result_type)) { var_class_requires_const = true; - if (!var->src_is_const && !is_comptime_var) { + if (!var->gen_is_const && !is_comptime_var) { ir_add_error_node(ira, source_node, buf_sprintf("variable of type '%s' must be const or comptime", buf_ptr(&result_type->name))); |
