aboutsummaryrefslogtreecommitdiff
path: root/src/ir.cpp
diff options
context:
space:
mode:
authorLemonBoy <thatlemon@gmail.com>2019-12-08 10:37:53 +0100
committerAndrew Kelley <andrew@ziglang.org>2019-12-08 10:28:29 -0500
commit19c1b5a33a21bdddfbbca3c65b1c0e6419c4629f (patch)
treef91d9c382ccc40d80ba0904bdaf4ff20cdc5d705 /src/ir.cpp
parent05fc4d34a93d1e8fd4a107cb17c9d4fd7ffc29bc (diff)
downloadzig-19c1b5a33a21bdddfbbca3c65b1c0e6419c4629f.tar.gz
zig-19c1b5a33a21bdddfbbca3c65b1c0e6419c4629f.zip
Fix for @Type not picking up the sentinel value
The code converted the whole TypeInfo payload into an optional type instead of using the "sentinel" field value. Fixes #3828
Diffstat (limited to 'src/ir.cpp')
-rw-r--r--src/ir.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/ir.cpp b/src/ir.cpp
index abf315b797..9b99fed42c 100644
--- a/src/ir.cpp
+++ b/src/ir.cpp
@@ -23065,7 +23065,7 @@ static Error get_const_field_sentinel(IrAnalyze *ira, IrInstruction *source_inst
if (field_val == nullptr)
return ErrorSemanticAnalyzeFail;
- IrInstruction *field_inst = ir_const(ira, source_instr, field_val->type);
+ IrInstruction *field_inst = ir_const_move(ira, source_instr, field_val);
IrInstruction *casted_field_inst = ir_implicit_cast(ira, field_inst,
get_optional_type(ira->codegen, elem_type));
if (type_is_invalid(casted_field_inst->value->type))