luaur_analysis/methods/
overload_resolver_new.rs1use 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 new(
14 builtin_types: *mut BuiltinTypes,
15 arena: *mut TypeArena,
16 normalizer: *mut Normalizer,
17 type_function_runtime: *mut TypeFunctionRuntime,
18 scope: *mut Scope,
19 reporter: *mut InternalErrorReporter,
20 limits: *mut TypeCheckLimits,
21 call_location: Location,
22 ) -> Self {
23 Self {
24 builtin_types,
25 arena,
26 normalizer,
27 type_function_runtime,
28 scope,
29 ice: reporter,
30 limits: unsafe { (*limits).clone() },
31 subtyping: Subtyping::subtyping_owned(
32 builtin_types,
33 arena,
34 normalizer,
35 type_function_runtime,
36 reporter,
37 ),
38 call_loc: call_location,
39 }
40 }
41}