This commit is contained in:
Alex Waygood 2025-11-02 01:01:28 -04:00
parent 349e24db9a
commit 80f045a261
1 changed files with 13 additions and 0 deletions

View File

@ -4124,6 +4124,19 @@ impl<'db> Type<'db> {
Type::Intersection(intersection) => intersection Type::Intersection(intersection) => intersection
.map_with_boundness_and_qualifiers(db, |elem| { .map_with_boundness_and_qualifiers(db, |elem| {
elem.member_lookup_with_policy(db, name_str.into(), policy) elem.member_lookup_with_policy(db, name_str.into(), policy)
})
.or_fall_back_to(db, || {
if intersection
.positive(db)
.iter()
.any(|element| element.is_type_var())
{
intersection
.with_positive_typevars_solved_to_bounds_or_constraints(db)
.member_lookup_with_policy(db, name, policy)
} else {
Place::Undefined.into()
}
}), }),
Type::Dynamic(..) | Type::Never => Place::bound(self).into(), Type::Dynamic(..) | Type::Never => Place::bound(self).into(),