From 42813126d92cc1fb145e75752b5a95d884ea9a12 Mon Sep 17 00:00:00 2001 From: Edwin Cheng Date: Tue, 24 Dec 2019 23:39:44 +0800 Subject: Check if parameters is empty --- crates/ra_hir_ty/src/infer.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'crates/ra_hir_ty') diff --git a/crates/ra_hir_ty/src/infer.rs b/crates/ra_hir_ty/src/infer.rs index e40df65e3..32c0d07a5 100644 --- a/crates/ra_hir_ty/src/infer.rs +++ b/crates/ra_hir_ty/src/infer.rs @@ -387,10 +387,12 @@ impl<'a, D: HirDatabase> InferenceContext<'a, D> { if let Ty::Opaque(ref predicates) = inner_ty { for p in predicates.iter() { if let GenericPredicate::Projection(projection) = p { - if projection.projection_ty.associated_ty == res_assoc_ty - && projection.ty != Ty::Unknown - { - return projection.ty.clone(); + if projection.projection_ty.associated_ty == res_assoc_ty { + if let ty_app!(_, params) = &projection.ty { + if params.len() == 0 { + return projection.ty.clone(); + } + } } } } -- cgit v1.2.3