luaur_analysis/methods/
replace_generics_clean_instantiation_alt_b.rs1use crate::records::free_type_pack::FreeTypePack;
2use crate::records::replace_generics::ReplaceGenerics;
3use crate::type_aliases::type_pack_id::TypePackId;
4use luaur_common::macros::luau_assert::LUAU_ASSERT;
5
6impl ReplaceGenerics {
7 pub fn clean_type_pack_id(&mut self, tp: TypePackId) -> TypePackId {
8 LUAU_ASSERT!(self.is_dirty_type_pack_id(tp));
9 let mut pack = FreeTypePack::new(self.level);
10 pack.scope = self.scope;
11 self.base.add_type_pack(pack)
12 }
13}