aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src/ty.rs
diff options
context:
space:
mode:
authorbors[bot] <bors[bot]@users.noreply.github.com>2019-01-25 20:36:56 +0000
committerbors[bot] <bors[bot]@users.noreply.github.com>2019-01-25 20:36:56 +0000
commitd0ddc5a7c1e3f3df09f4e3637cc80459d8273310 (patch)
tree551a026f63068eb9290f8e7c8f8d1a8b4322dd5d /crates/ra_hir/src/ty.rs
parentd3b5ff8fe679b4e66e8af71db063b01d34fec3fc (diff)
parent5a1385007cb7509d50a77afa5a47ed0685f7f2f9 (diff)
Merge #655
655: Fix type inference of binops on int/float variables r=matklad a=flodiebold Fixes #651. Co-authored-by: Florian Diebold <[email protected]>
Diffstat (limited to 'crates/ra_hir/src/ty.rs')
-rw-r--r--crates/ra_hir/src/ty.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/crates/ra_hir/src/ty.rs b/crates/ra_hir/src/ty.rs
index 714eaaae5..179ebddee 100644
--- a/crates/ra_hir/src/ty.rs
+++ b/crates/ra_hir/src/ty.rs
@@ -790,7 +790,10 @@ fn binary_op_return_ty(op: BinaryOp, rhs_ty: Ty) -> Ty {
790 | BinaryOp::BitwiseAnd 790 | BinaryOp::BitwiseAnd
791 | BinaryOp::BitwiseOr 791 | BinaryOp::BitwiseOr
792 | BinaryOp::BitwiseXor => match rhs_ty { 792 | BinaryOp::BitwiseXor => match rhs_ty {
793 Ty::Int(..) | Ty::Float(..) => rhs_ty, 793 Ty::Int(..)
794 | Ty::Float(..)
795 | Ty::Infer(InferTy::IntVar(..))
796 | Ty::Infer(InferTy::FloatVar(..)) => rhs_ty,
794 _ => Ty::Unknown, 797 _ => Ty::Unknown,
795 }, 798 },
796 BinaryOp::RangeRightOpen | BinaryOp::RangeRightClosed => Ty::Unknown, 799 BinaryOp::RangeRightOpen | BinaryOp::RangeRightClosed => Ty::Unknown,