Skip to main content

luaur_analysis/methods/
normalizer_intersect_functions.rs

1use crate::records::normalized_function_type::NormalizedFunctionType;
2use crate::records::normalizer::Normalizer;
3use crate::type_aliases::type_id::TypeId;
4
5impl Normalizer {
6    pub fn intersect_functions(
7        &mut self,
8        heres: &mut NormalizedFunctionType,
9        theres: &NormalizedFunctionType,
10    ) {
11        self.consume_fuel();
12
13        if heres.is_never() {
14            return;
15        } else if theres.is_never() {
16            heres.reset_to_never();
17            return;
18        } else {
19            for there in theres.parts.order.iter() {
20                let there = *there;
21                self.intersect_functions_with_function(heres, there);
22            }
23        }
24    }
25}