Fix #1994 Returning to err: Maybe(Error) raises compiler assert

This commit is contained in:
gingerBill
2022-09-01 16:33:44 +01:00
parent 902a6db0e1
commit 3e3b9ae2df

View File

@@ -1924,7 +1924,7 @@ lbValue lb_emit_conv(lbProcedure *p, lbValue value, Type *t) {
}
if (dst->Union.variants.count == 1) {
Type *vt = dst->Union.variants[0];
if (internal_check_is_assignable_to(src, vt)) {
if (internal_check_is_assignable_to(src_type, vt)) {
value = lb_emit_conv(p, value, vt);
lbAddr parent = lb_add_local_generated(p, t, true);
lb_emit_store_union_variant(p, parent.addr, value, vt);