From 19c1b5a33a21bdddfbbca3c65b1c0e6419c4629f Mon Sep 17 00:00:00 2001 From: LemonBoy Date: Sun, 8 Dec 2019 10:37:53 +0100 Subject: 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 --- src/ir.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/ir.cpp') 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)) -- cgit v1.2.3