[ty] Add Salsa caching to TupleType::to_class_type (#19840)

This commit is contained in:
Alex Waygood
2025-08-09 09:29:26 +01:00
committed by GitHub
parent 3a542a80f6
commit 5a116e48c3

View File

@@ -172,6 +172,7 @@ impl<'db> Type<'db> {
}
}
#[salsa::tracked]
impl<'db> TupleType<'db> {
pub(crate) fn new<T>(db: &'db dyn Db, tuple_key: T) -> Option<Self>
where
@@ -225,6 +226,7 @@ impl<'db> TupleType<'db> {
TupleType::new(db, TupleSpec::homogeneous(element))
}
#[salsa::tracked]
pub(crate) fn to_class_type(self, db: &'db dyn Db) -> Option<ClassType<'db>> {
KnownClass::Tuple
.try_to_class_literal(db)