allow implicit cast of undefined to optional

This commit is contained in:
Andrew Kelley
2018-07-16 19:26:15 -04:00
parent 9b56efc957
commit 0fa24b6b75
2 changed files with 18 additions and 1 deletions

View File

@@ -9408,7 +9408,7 @@ static IrInstruction *ir_analyze_maybe_wrap(IrAnalyze *ira, IrInstruction *sourc
if (type_is_invalid(casted_payload->value.type))
return ira->codegen->invalid_instruction;
ConstExprValue *val = ir_resolve_const(ira, casted_payload, UndefBad);
ConstExprValue *val = ir_resolve_const(ira, casted_payload, UndefOk);
if (!val)
return ira->codegen->invalid_instruction;