Skip to content

Commit 244c4f2

Browse files
committed
more compile errors after rebase
1 parent db8040c commit 244c4f2

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed

crates/ty_python_semantic/src/types.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5027,7 +5027,7 @@ impl<'db> Type<'db> {
50275027
),
50285028

50295029
Type::ProtocolInstance(instance) => {
5030-
Type::ProtocolInstance(instance.apply_specialization(db, specialization))
5030+
Type::ProtocolInstance(instance.apply_specialization(db, type_mapping))
50315031
}
50325032

50335033
Type::MethodWrapper(MethodWrapperKind::FunctionTypeDunderGet(function)) => {

crates/ty_python_semantic/src/types/instance.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -247,17 +247,17 @@ impl<'db> ProtocolInstanceType<'db> {
247247
}
248248
}
249249

250-
pub(super) fn apply_specialization(
250+
pub(super) fn apply_specialization<'a>(
251251
self,
252252
db: &'db dyn Db,
253-
specialization: Specialization<'db>,
253+
type_mapping: TypeMapping<'a, 'db>,
254254
) -> Self {
255255
match self.0 {
256256
Protocol::FromClass(class) => Self(Protocol::FromClass(
257-
class.apply_specialization(db, specialization),
257+
class.apply_type_mapping(db, type_mapping),
258258
)),
259259
Protocol::Synthesized(synthesized) => Self(Protocol::Synthesized(
260-
synthesized.apply_specialization(db, specialization),
260+
synthesized.apply_type_mapping(db, type_mapping),
261261
)),
262262
}
263263
}
@@ -288,7 +288,7 @@ impl<'db> Protocol<'db> {
288288

289289
mod synthesized_protocol {
290290
use crate::db::Db;
291-
use crate::types::generics::Specialization;
291+
use crate::types::generics::TypeMapping;
292292
use crate::types::protocol_class::ProtocolInterface;
293293

294294
/// A "synthesized" protocol type that is dissociated from a class definition in source code.
@@ -308,12 +308,12 @@ mod synthesized_protocol {
308308
Self(interface.normalized(db))
309309
}
310310

311-
pub(super) fn apply_specialization(
311+
pub(super) fn apply_type_mapping<'a>(
312312
self,
313313
db: &'db dyn Db,
314-
specialization: Specialization<'db>,
314+
type_mapping: TypeMapping<'a, 'db>,
315315
) -> Self {
316-
Self(self.0.specialized_and_normalized(db, specialization))
316+
Self(self.0.specialized_and_normalized(db, type_mapping))
317317
}
318318

319319
pub(in crate::types) fn interface(self) -> ProtocolInterface<'db> {

crates/ty_python_semantic/src/types/protocol_class.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use crate::{
88
db::Db,
99
semantic_index::{symbol_table, use_def_map},
1010
symbol::{symbol_from_bindings, symbol_from_declarations},
11-
types::{ClassBase, ClassLiteral, KnownFunction, Specialization, Type, TypeQualifiers},
11+
types::{ClassBase, ClassLiteral, KnownFunction, Type, TypeMapping, TypeQualifiers},
1212
};
1313

1414
impl<'db> ClassLiteral<'db> {
@@ -117,10 +117,10 @@ impl<'db> ProtocolInterface<'db> {
117117
)
118118
}
119119

120-
pub(super) fn specialized_and_normalized(
120+
pub(super) fn specialized_and_normalized<'a>(
121121
self,
122122
db: &'db dyn Db,
123-
specialization: Specialization<'db>,
123+
type_mapping: TypeMapping<'a, 'db>,
124124
) -> Self {
125125
Self::new(
126126
db,
@@ -129,7 +129,7 @@ impl<'db> ProtocolInterface<'db> {
129129
.map(|(name, data)| {
130130
(
131131
name.clone(),
132-
data.apply_specialization(db, specialization).normalized(db),
132+
data.apply_type_mapping(db, type_mapping).normalized(db),
133133
)
134134
})
135135
.collect::<BTreeMap<_, _>>(),
@@ -151,9 +151,9 @@ impl<'db> ProtocolMemberData<'db> {
151151
}
152152
}
153153

154-
fn apply_specialization(&self, db: &'db dyn Db, specialization: Specialization<'db>) -> Self {
154+
fn apply_type_mapping<'a>(&self, db: &'db dyn Db, type_mapping: TypeMapping<'a, 'db>) -> Self {
155155
Self {
156-
ty: self.ty.apply_specialization(db, specialization),
156+
ty: self.ty.apply_type_mapping(db, type_mapping),
157157
qualifiers: self.qualifiers,
158158
}
159159
}

0 commit comments

Comments
 (0)