fix: treat enum variants as generic item on their own

This commit is contained in:
Ryo Yoshida 2022-10-04 00:07:34 +09:00
parent 7556f74b16
commit e0a161b2e3
No known key found for this signature in database
GPG key ID: E25698A930586171
2 changed files with 12 additions and 10 deletions

View file

@ -192,9 +192,7 @@ impl TyBuilder<()> {
parent_subst: Option<Substitution>,
) -> TyBuilder<()> {
let generics = generics(db.upcast(), def.into());
// FIXME: this assertion should hold but some adjustment around
// `ValueTyDefId::EnumVariantId` is needed.
// assert!(generics.parent_generics().is_some() == parent_subst.is_some());
assert!(generics.parent_generics().is_some() == parent_subst.is_some());
let params = generics
.iter_self()
.map(|(id, data)| match data {