luaur_analysis/methods/
scope_lookup_scope.rs1use crate::records::binding::Binding;
2use crate::records::scope::Scope;
3use crate::records::symbol::Symbol;
4use crate::type_aliases::type_id::TypeId;
5
6impl Scope {
7 pub fn lookup_symbol(&self, sym: Symbol) -> Option<TypeId> {
8 let mut mutable_self = self as *const Scope as *mut Scope;
9 let r = unsafe { (*mutable_self).lookup_ex_symbol(sym) };
10
11 if let Some((binding, _)) = r {
12 Some(unsafe { (*binding).type_id })
13 } else {
14 None
15 }
16 }
17}