Skip to main content

luaur_analysis/methods/
instantiation_ignore_children.rs

1use crate::records::extern_type::ExternType;
2use crate::records::function_type::FunctionType;
3use crate::records::instantiation::Instantiation;
4use crate::type_aliases::type_id::TypeId;
5
6use crate::functions::get_type_alt_j::get_type_id;
7use crate::functions::get_type_utils::get_optional_ty;
8
9impl Instantiation {
10    pub fn ignore_children(&self, ty: TypeId) -> bool {
11        let ft = unsafe { get_type_id::<FunctionType>(ty) };
12        if !ft.is_null() {
13            return true;
14        }
15
16        let et = unsafe { get_optional_ty::<ExternType, TypeId>(Some(ty)) };
17        !et.is_null()
18    }
19}