Skip to content

Commit

Permalink
allow u64 promote to i64
Browse files Browse the repository at this point in the history
  • Loading branch information
yuyi98 committed Dec 4, 2024
1 parent c6d23b5 commit 4faa8cd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion vlib/v/checker/check_types.v
Original file line number Diff line number Diff line change
Expand Up @@ -741,7 +741,7 @@ fn (c &Checker) promote_num(left_type ast.Type, right_type ast.Type) ast.Type {
return type_lo // conversion unsigned u16 -> signed if signed type is larger
} else if idx_hi == ast.u32_type_idx && idx_lo > ast.int_type_idx {
return type_lo // conversion unsigned u32 -> signed if signed type is larger
} else if idx_hi == ast.u64_type_idx && idx_lo > ast.i64_type_idx {
} else if idx_hi == ast.u64_type_idx && idx_lo >= ast.i64_type_idx {
return type_lo // conversion unsigned u64 -> signed if signed type is larger
} else if idx_hi == ast.usize_type_idx && idx_lo > ast.isize_type_idx {
return type_lo // conversion unsigned usize -> signed if signed type is larger
Expand Down

0 comments on commit 4faa8cd

Please sign in to comment.