Skip to main content

luaur_analysis/methods/
normalizer_union_of_tops.rs

1use crate::functions::get_type_alt_j::get_type_id;
2use crate::records::any_type::AnyType;
3use crate::records::never_type::NeverType;
4use crate::records::normalizer::Normalizer;
5use crate::type_aliases::type_id::TypeId;
6
7impl Normalizer {
8    pub fn union_of_tops(&mut self, here: TypeId, there: TypeId) -> TypeId {
9        self.consume_fuel();
10
11        if !unsafe { get_type_id::<NeverType>(here).is_null() }
12            || !unsafe { get_type_id::<AnyType>(there).is_null() }
13        {
14            return there;
15        }
16
17        here
18    }
19}