aboutsummaryrefslogtreecommitdiff
path: root/src/check_expr.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/check_expr.cpp')
-rw-r--r--src/check_expr.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/check_expr.cpp b/src/check_expr.cpp
index d135cf3dd..fab388d9f 100644
--- a/src/check_expr.cpp
+++ b/src/check_expr.cpp
@@ -6837,14 +6837,14 @@ ExprKind check_expr_base_internal(Checker *c, Operand *o, AstNode *node, Type *t
o->type = t;
o->mode = Addressing_OptionalOk;
- } else if (is_type_any(o->type)) {
+ } else if (is_type_any(src)) {
o->type = t;
o->mode = Addressing_OptionalOk;
add_type_info_type(c, o->type);
add_type_info_type(c, t);
} else {
- error(o->expr, "Type assertions can only operate on unions");
+ error(o->expr, "Type assertions can only operate on unions and `any`");
o->mode = Addressing_Invalid;
o->expr = node;
return kind;