[ty] Narrow type context during literal promotion in generic class constructors (#21574)
## Summary Resolves https://github.com/astral-sh/ty/issues/1603.
This commit is contained in:
@@ -3504,9 +3504,10 @@ impl<'db> Type<'db> {
|
||||
return;
|
||||
};
|
||||
|
||||
let tcx_specialization = tcx
|
||||
.annotation
|
||||
.and_then(|tcx| tcx.specialization_of(db, class_literal));
|
||||
let tcx_specialization = tcx.annotation.and_then(|tcx| {
|
||||
tcx.filter_union(db, |ty| ty.specialization_of(db, class_literal).is_some())
|
||||
.specialization_of(db, class_literal)
|
||||
});
|
||||
|
||||
for (typevar, ty) in specialization
|
||||
.generic_context(db)
|
||||
|
||||
Reference in New Issue
Block a user