[ty] Cache legacy generic context

This commit is contained in:
Micha Reiser 2025-12-16 12:48:57 +01:00
parent 682d29c256
commit 19881f4cc3
No known key found for this signature in database
1 changed files with 3 additions and 0 deletions

View File

@ -1566,6 +1566,9 @@ impl<'db> ClassLiteral<'db> {
}) })
} }
#[salsa::tracked(cycle_initial=generic_context_cycle_initial,
heap_size=ruff_memory_usage::heap_size,
)]
pub(crate) fn legacy_generic_context(self, db: &'db dyn Db) -> Option<GenericContext<'db>> { pub(crate) fn legacy_generic_context(self, db: &'db dyn Db) -> Option<GenericContext<'db>> {
self.explicit_bases(db).iter().find_map(|base| match base { self.explicit_bases(db).iter().find_map(|base| match base {
Type::KnownInstance( Type::KnownInstance(