Support inferring Self type in enum definitions

Signed-off-by: ice1000 <ice1000kotlin@foxmail.com>
This commit is contained in:
ice1000 2019-09-27 00:19:52 -04:00
parent c73193efe2
commit 6bad638928
7 changed files with 54 additions and 9 deletions

View file

@ -216,7 +216,7 @@ impl SourceAnalyzer {
let types = self.resolver.resolve_path_in_type_ns_fully(db, &path).map(|ty| match ty {
TypeNs::SelfType(it) => PathResolution::SelfType(it),
TypeNs::GenericParam(it) => PathResolution::GenericParam(it),
TypeNs::Adt(it) => PathResolution::Def(it.into()),
TypeNs::AdtSelfType(it) | TypeNs::Adt(it) => PathResolution::Def(it.into()),
TypeNs::EnumVariant(it) => PathResolution::Def(it.into()),
TypeNs::TypeAlias(it) => PathResolution::Def(it.into()),
TypeNs::BuiltinType(it) => PathResolution::Def(it.into()),