aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src/ty/infer.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_hir/src/ty/infer.rs')
-rw-r--r--crates/ra_hir/src/ty/infer.rs10
1 files changed, 7 insertions, 3 deletions
diff --git a/crates/ra_hir/src/ty/infer.rs b/crates/ra_hir/src/ty/infer.rs
index 675df4a22..cca59538a 100644
--- a/crates/ra_hir/src/ty/infer.rs
+++ b/crates/ra_hir/src/ty/infer.rs
@@ -1265,9 +1265,7 @@ impl<'a, D: HirDatabase> InferenceContext<'a, D> {
1265 Expr::BinaryOp { lhs, rhs, op } => match op { 1265 Expr::BinaryOp { lhs, rhs, op } => match op {
1266 Some(op) => { 1266 Some(op) => {
1267 let lhs_expectation = match op { 1267 let lhs_expectation = match op {
1268 BinaryOp::BooleanAnd | BinaryOp::BooleanOr => { 1268 BinaryOp::LogicOp(..) => Expectation::has_type(Ty::simple(TypeCtor::Bool)),
1269 Expectation::has_type(Ty::simple(TypeCtor::Bool))
1270 }
1271 _ => Expectation::none(), 1269 _ => Expectation::none(),
1272 }; 1270 };
1273 let lhs_ty = self.infer_expr(*lhs, &lhs_expectation); 1271 let lhs_ty = self.infer_expr(*lhs, &lhs_expectation);
@@ -1281,6 +1279,12 @@ impl<'a, D: HirDatabase> InferenceContext<'a, D> {
1281 } 1279 }
1282 _ => Ty::Unknown, 1280 _ => Ty::Unknown,
1283 }, 1281 },
1282 Expr::Index { base, index } => {
1283 let _base_ty = self.infer_expr(*base, &Expectation::none());
1284 let _index_ty = self.infer_expr(*index, &Expectation::none());
1285 // FIXME: use `std::ops::Index::Output` to figure out the real return type
1286 Ty::Unknown
1287 }
1284 Expr::Tuple { exprs } => { 1288 Expr::Tuple { exprs } => {
1285 let mut ty_vec = Vec::with_capacity(exprs.len()); 1289 let mut ty_vec = Vec::with_capacity(exprs.len());
1286 for arg in exprs.iter() { 1290 for arg in exprs.iter() {