error set casting building

This commit is contained in:
Andrew Kelley
2018-02-08 11:09:18 -05:00
parent 76239f2089
commit fee875770c
4 changed files with 29 additions and 39 deletions

View File

@@ -2081,6 +2081,9 @@ static LLVMValueRef ir_render_cast(CodeGen *g, IrExecutable *executable,
assert(wanted_type->id == TypeTableEntryIdInt);
assert(actual_type->id == TypeTableEntryIdBool);
return LLVMBuildZExt(g->builder, expr_val, wanted_type->type_ref, "");
case CastOpErrSet:
// TODO runtime safety for error casting
return expr_val;
}
zig_unreachable();
}