luaur-analysis 0.1.3

Luau type checker and type inference (Rust).
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use crate::records::constraint_generator::ConstraintGenerator;
use crate::type_aliases::type_error_data::TypeErrorData;
use luaur_ast::records::location::Location;

impl ConstraintGenerator {
    pub fn report_error(&mut self, location: Location, err: TypeErrorData) {
        unsafe {
            self.errors.push(crate::records::type_error::TypeError {
                location,
                module_name: (*self.module.as_ref().unwrap()).name.clone(),
                data: err.clone(),
            });
            if !self.logger.is_null() {
                (*self.logger).capture_generation_error(self.errors.last().unwrap());
            }
        }
    }
}