Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir/src/source_analyzer.rs')
| -rw-r--r-- | crates/hir/src/source_analyzer.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/crates/hir/src/source_analyzer.rs b/crates/hir/src/source_analyzer.rs index 35aef32824..7a65fd99cf 100644 --- a/crates/hir/src/source_analyzer.rs +++ b/crates/hir/src/source_analyzer.rs @@ -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))), } } |