Skip to main content

luaur_analysis/methods/
overload_resolver_overload_resolver.rs

1use crate::records::builtin_types::BuiltinTypes;
2use crate::records::internal_error_reporter::InternalErrorReporter;
3use crate::records::normalizer::Normalizer;
4use crate::records::overload_resolver::OverloadResolver;
5use crate::records::scope::Scope;
6use crate::records::subtyping::Subtyping;
7use crate::records::type_arena::TypeArena;
8use crate::records::type_check_limits::TypeCheckLimits;
9use crate::records::type_function_runtime::TypeFunctionRuntime;
10use luaur_ast::records::location::Location;
11
12impl OverloadResolver {
13    pub fn overload_resolver_not_null_builtin_types_not_null_type_arena_not_null_normalizer_not_null_type_function_runtime_not_null_scope_not_null_internal_error_reporter_not_null_type_check_limits_location(
14        &mut self,
15        builtin_types: *mut BuiltinTypes,
16        arena: *mut TypeArena,
17        normalizer: *mut Normalizer,
18        type_function_runtime: *mut TypeFunctionRuntime,
19        scope: *mut Scope,
20        reporter: *mut InternalErrorReporter,
21        limits: *mut TypeCheckLimits,
22        call_location: Location,
23    ) {
24        self.builtin_types = builtin_types;
25        self.arena = arena;
26        self.normalizer = normalizer;
27        self.type_function_runtime = type_function_runtime;
28        self.scope = scope;
29        self.ice = reporter;
30        self.limits = unsafe { core::ptr::read(limits as *const TypeCheckLimits) };
31        self.call_loc = call_location;
32
33        // subtyping({builtinTypes, arena, normalizer, typeFunctionRuntime, ice})
34        let subtyping = Subtyping::subtyping_owned(
35            builtin_types,
36            arena,
37            normalizer,
38            type_function_runtime,
39            reporter,
40        );
41        self.subtyping = subtyping;
42    }
43}