implement creating generics for impl traits in associated types

This commit is contained in:
dfireBird 2024-04-29 23:55:02 +05:30
parent f216be4a07
commit 40a677ddf0
No known key found for this signature in database
GPG key ID: 26D522CA5FC2B93D
6 changed files with 102 additions and 17 deletions

View file

@ -208,6 +208,13 @@ pub(super) fn lower_generic_args(
.and_then(|args| lower_generic_args(lower_ctx, args))
.map(Interned::new);
let type_ref = assoc_type_arg.ty().map(|it| TypeRef::from_ast(lower_ctx, it));
let type_ref = type_ref.inspect(|tr| {
tr.walk(&mut |tr| {
if let TypeRef::ImplTrait(bounds) = tr {
lower_ctx.update_impl_traits_bounds(bounds.clone());
}
});
});
let bounds = if let Some(l) = assoc_type_arg.type_bound_list() {
l.bounds()
.map(|it| Interned::new(TypeBound::from_ast(lower_ctx, it)))