Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
felipensp committed Mar 3, 2024
1 parent ac9b724 commit 78ccaa7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion vlib/v/checker/checker.v
Original file line number Diff line number Diff line change
Expand Up @@ -3148,7 +3148,7 @@ fn (mut c Checker) cast_expr(mut node ast.CastExpr) ast.Type {
tt := c.table.type_to_str(to_type)
c.error('cannot cast `${ft}` to `${tt}`', node.pos)
}
} else if mut to_sym.info is ast.Interface {
} else if !from_type.has_option_or_result() && mut to_sym.info is ast.Interface {
if c.type_implements(from_type, to_type, node.pos) {
if !from_type.is_any_kind_of_pointer() && from_sym.kind != .interface_
&& !c.inside_unsafe {
Expand Down

0 comments on commit 78ccaa7

Please sign in to comment.