Refactor some more

Type-relative paths (`<T>::foo`) also need to work in type context, for example
`<T>::Item` is legal. So rather than returning the type ref from the resolver
function, just check it before.
This commit is contained in:
Florian Diebold
2019-09-16 21:38:27 +02:00
parent 406280e52f
commit fe1dfd2b20
4 changed files with 100 additions and 57 deletions

View File

@@ -190,6 +190,13 @@ impl Path {
pub fn expand_macro_expr(&self) -> Option<Name> {
self.as_ident().and_then(|name| Some(name.clone()))
}
pub fn is_type_relative(&self) -> bool {
match self.kind {
PathKind::Type(_) => true,
_ => false,
}
}
}
impl GenericArgs {