luaur_analysis/methods/
txn_log_bind_table.rs1use crate::records::pending_type::PendingType;
2use crate::records::table_type::TableType;
3use crate::records::txn_log::TxnLog;
4use crate::type_aliases::type_id::TypeId;
5use luaur_common::macros::luau_assert::LUAU_ASSERT;
6
7impl TxnLog {
8 pub fn bind_table(&mut self, ty: TypeId, new_bound_to: Option<TypeId>) -> *mut PendingType {
9 let new_ty = self.queue_type_id(ty);
12
13 unsafe {
16 let table_type = crate::functions::get_mutable_txn_log::get_mutable_pending_type::<
17 TableType,
18 >(new_ty);
19 if !table_type.is_null() {
20 (*table_type).bound_to = new_bound_to;
21 }
22 }
23
24 new_ty
25 }
26}