diff --git a/vlib/v/checker/checker.v b/vlib/v/checker/checker.v index 91a6789e186210..1ae419bf69f4db 100644 --- a/vlib/v/checker/checker.v +++ b/vlib/v/checker/checker.v @@ -3569,7 +3569,7 @@ fn (mut c Checker) cast_expr(mut node ast.CastExpr) ast.Type { c.error('cannot cast incompatible option ${final_to_sym.name} `${ft}` to `${tt}`', node.pos) } else if !from_type.is_ptr() && final_from_sym.kind == .struct - && to_sym.kind !in [.struct, .voidptr] { + && final_to_sym.kind !in [.struct, .voidptr] { ft := c.table.type_to_str(from_type) tt := c.table.type_to_str(to_type) c.error('cannot cast type `${ft}` to `${tt}`', node.pos)