aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2020-02-23 10:20:12 +0000
committergingerBill <bill@gingerbill.org>2020-02-23 10:20:12 +0000
commit8a6777514985793bc607ea1b915675a566033730 (patch)
treebb1c866a397d49abad0cbf649947d269ef51814b /src
parent85e331d5e21ed01feb03efc02cf6517fa9c3a20e (diff)
Fix #571
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;
}