#11973 associated type is unresolved

This commit is contained in:
bitgaoshu 2022-04-24 20:51:48 +08:00 committed by 风维
parent 1894473b19
commit 5d1aff3357
2 changed files with 50 additions and 1 deletions

View file

@ -652,7 +652,13 @@ fn resolve_hir_path_(
let (ty, remaining) =
resolver.resolve_path_in_type_ns(db.upcast(), path.mod_path())?;
match remaining {
Some(remaining) if remaining > 1 => None,
Some(remaining) if remaining > 1 => {
if remaining + 1 == path.segments().len() {
Some((ty, path.segments().last()))
} else {
None
}
}
_ => Some((ty, path.segments().get(1))),
}
}