aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/check_expr.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/check_expr.cpp b/src/check_expr.cpp
index 722acaa24..d98b3d0d6 100644
--- a/src/check_expr.cpp
+++ b/src/check_expr.cpp
@@ -2260,6 +2260,8 @@ bool check_cast_internal(CheckerContext *c, Operand *x, Type *type) {
x->mode = Addressing_Value;
} else if (is_type_slice(type) && is_type_string(x->type)) {
x->mode = Addressing_Value;
+ } else if (is_type_union(type)) {
+ x->mode = Addressing_Value;
}
return true;
}