Check if parameters is empty

This commit is contained in:
Edwin Cheng 2019-12-24 23:39:44 +08:00
parent 3a2cf708ed
commit 42813126d9

View File

@ -387,14 +387,16 @@ 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
{
if projection.projection_ty.associated_ty == res_assoc_ty {
if let ty_app!(_, params) = &projection.ty {
if params.len() == 0 {
return projection.ty.clone();
}
}
}
}
}
}
let ty = self.table.new_type_var();
let builder = Substs::build_for_def(self.db, res_assoc_ty)