Complete associated methods on enums (and unions) as well

This commit is contained in:
Florian Diebold 2019-06-29 12:40:01 +02:00
parent 64f71dd3ff
commit d37f960dfa
4 changed files with 91 additions and 6 deletions

View file

@ -390,6 +390,10 @@ impl Union {
self.id.module(db)
}
pub fn ty(self, db: &impl HirDatabase) -> Ty {
db.type_for_def(self.into(), Namespace::Types)
}
// FIXME move to a more general type
/// Builds a resolver for type references inside this union.
pub(crate) fn resolver(self, db: &impl HirDatabase) -> Resolver {