luaur_analysis/methods/
normalizer_intersect_normal_with_negation_ty.rs1use crate::enums::normalization_result::NormalizationResult;
2use crate::records::normalized_type::NormalizedType;
3use crate::records::normalizer::Normalizer;
4use crate::type_aliases::type_id::TypeId;
5
6impl Normalizer {
7 pub fn intersect_normal_with_negation_ty(
8 &mut self,
9 to_negate: TypeId,
10 intersect: &mut NormalizedType,
11 ) -> NormalizationResult {
12 self.consume_fuel();
13
14 let normal = self.normalize(to_negate);
15 let negated = self.negate_normal(&normal);
16
17 match negated {
18 Some(negated_type) => self.intersect_normals(intersect, &negated_type, 0),
19 None => NormalizationResult::False,
20 }
21 }
22}