luaur_analysis/functions/
fresh_type.rs1use crate::enums::polarity::Polarity;
2use crate::records::builtin_types::BuiltinTypes;
3use crate::records::free_type::FreeType;
4use crate::records::scope::Scope;
5use crate::records::type_arena::TypeArena;
6use crate::type_aliases::type_id::TypeId;
7
8pub fn fresh_type(
9 arena: &mut TypeArena,
10 builtin_types: &BuiltinTypes,
11 scope: *mut Scope,
12 polarity: Polarity,
13) -> TypeId {
14 let free_type = FreeType::free_type_scope_type_id_type_id_polarity(
15 scope,
16 builtin_types.neverType,
17 builtin_types.unknownType,
18 polarity,
19 );
20 arena.add_type(free_type)
21}