Refactor a bit to prepare for resolving trait assoc items

This commit is contained in:
Florian Diebold 2019-09-14 16:26:03 +02:00
parent 913ab1ec0a
commit 828d60574f
10 changed files with 85 additions and 54 deletions

View file

@ -50,7 +50,7 @@ pub(crate) enum Scope {
ExprScope(ExprScope),
}
#[derive(Debug, Clone, PartialEq, Eq)]
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum TypeNs {
SelfType(ImplBlock),
GenericParam(u32),
@ -59,19 +59,19 @@ pub enum TypeNs {
TypeAlias(TypeAlias),
BuiltinType(BuiltinType),
Trait(Trait),
// Module belong to type ns, but the resovler is used when all module paths
// Module belong to type ns, but the resolver is used when all module paths
// are fully resolved.
// Module(Module)
}
#[derive(Debug)]
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum ResolveValueResult<'a> {
ValueNs(ValueNs),
Partial(TypeNs, usize),
TypeRef(&'a TypeRef),
}
#[derive(Debug)]
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum ValueNs {
LocalBinding(PatId),
Function(Function),