We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Self
1 parent 7fd5d53 commit 0c7ca15Copy full SHA for 0c7ca15
crates/ty_python_semantic/src/types.rs
@@ -6777,8 +6777,15 @@ impl<'db> TypeMapping<'_, 'db> {
6777
| TypeMapping::PromoteLiterals
6778
| TypeMapping::BindLegacyTypevars(_)
6779
| TypeMapping::MarkTypeVarsInferable(_)
6780
- | TypeMapping::Materialize(_)
6781
- | TypeMapping::BindSelf(_) => context,
+ | TypeMapping::Materialize(_) => context,
+ TypeMapping::BindSelf(_) => GenericContext::from_typevar_instances(
6782
+ db,
6783
+ context
6784
+ .variables(db)
6785
+ .iter()
6786
+ .filter(|var| !var.typevar(db).is_self(db))
6787
+ .copied(),
6788
+ ),
6789
TypeMapping::ReplaceSelf { new_upper_bound } => GenericContext::from_typevar_instances(
6790
db,
6791
context.variables(db).iter().map(|typevar| {
0 commit comments