pub struct Unifier {Show 16 fields
pub types: *mut TypeArena,
pub builtin_types: *mut BuiltinTypes,
pub normalizer: *mut Normalizer,
pub scope: *mut Scope,
pub log: TxnLog,
pub failure: bool,
pub errors: ErrorVec,
pub location: Location,
pub variance: Variance,
pub normalize: bool,
pub check_inhabited: bool,
pub ctx: CountMismatchContext,
pub shared_state: *mut UnifierSharedState,
pub blocked_types: Vec<TypeId>,
pub blocked_type_packs: Vec<TypePackId>,
pub first_pack_error_pos: Option<i32>,
}Fields§
§types: *mut TypeArena§builtin_types: *mut BuiltinTypes§normalizer: *mut Normalizer§scope: *mut Scope§log: TxnLog§failure: bool§errors: ErrorVec§location: Location§variance: Variance§normalize: bool§check_inhabited: bool§ctx: CountMismatchContext§blocked_types: Vec<TypeId>§blocked_type_packs: Vec<TypePackId>§first_pack_error_pos: Option<i32>Implementations§
Source§impl Unifier
impl Unifier
pub fn unifier_cache_result( &mut self, sub_ty: TypeId, super_ty: TypeId, prev_error_count: usize, )
Source§impl Unifier
impl Unifier
pub fn unifier_can_cache_result( &mut self, sub_ty: TypeId, super_ty: TypeId, ) -> bool
Source§impl Unifier
impl Unifier
pub fn can_unify_type_id_type_id( &mut self, sub_ty: TypeId, super_ty: TypeId, ) -> ErrorVec
Source§impl Unifier
impl Unifier
pub fn can_unify_type_pack_id_type_pack_id_bool( &mut self, sub_tp: TypePackId, super_tp: TypePackId, is_function_call: bool, ) -> ErrorVec
Source§impl Unifier
impl Unifier
pub fn check_child_unifier_type_mismatch_error_vec_type_id_type_id( &mut self, inner_errors: &ErrorVec, wanted_type: TypeId, given_type: TypeId, )
Source§impl Unifier
impl Unifier
Sourcepub fn occurs_check_dense_hash_set_type_id_type_id_type_id(
&mut self,
seen: &mut DenseHashSet<TypeId>,
needle: TypeId,
haystack: TypeId,
) -> bool
pub fn occurs_check_dense_hash_set_type_id_type_id_type_id( &mut self, seen: &mut DenseHashSet<TypeId>, needle: TypeId, haystack: TypeId, ) -> bool
bool Unifier::occursCheck(DenseHashSet<TypeId>& seen, TypeId needle, TypeId haystack)
Source§impl Unifier
impl Unifier
pub fn occurs_check_type_pack_id_type_pack_id_bool( &mut self, needle: TypePackId, haystack: TypePackId, _reversed: bool, ) -> bool
Source§impl Unifier
impl Unifier
pub fn occurs_check_dense_hash_set_type_pack_id_type_pack_id_type_pack_id( &mut self, seen: &mut DenseHashSet<TypePackId>, needle: TypePackId, haystack: TypePackId, ) -> bool
Source§impl Unifier
impl Unifier
pub fn report_error_location_type_error_data( &mut self, location: Location, data: TypeErrorData, )
Source§impl Unifier
impl Unifier
Sourcepub fn unifier_try_apply_overloaded_function(
&mut self,
function: TypeId,
overloads: &NormalizedFunctionType,
args: TypePackId,
) -> TypePackId
pub fn unifier_try_apply_overloaded_function( &mut self, function: TypeId, overloads: &NormalizedFunctionType, args: TypePackId, ) -> TypePackId
TypePackId Unifier::tryApplyOverloadedFunction(TypeId function, const NormalizedFunctionType& overloads, TypePackId args)
Source§impl Unifier
impl Unifier
pub fn unifier_try_unify_functions( &mut self, sub_ty: TypeId, super_ty: TypeId, is_function_call: bool, )
Source§impl Unifier
impl Unifier
pub fn unifier_try_unify_intersection_with_type( &mut self, sub_ty: TypeId, uv: *const IntersectionType, super_ty: TypeId, cache_enabled: bool, is_function_call: bool, )
Source§impl Unifier
impl Unifier
pub fn unifier_try_unify_negations(&mut self, sub_ty: TypeId, super_ty: TypeId)
Source§impl Unifier
impl Unifier
Sourcepub fn unifier_try_unify_normalized_types(
&mut self,
sub_ty: TypeId,
super_ty: TypeId,
sub_norm: &NormalizedType,
super_norm: &NormalizedType,
reason: String,
error: Option<TypeError>,
)
pub fn unifier_try_unify_normalized_types( &mut self, sub_ty: TypeId, super_ty: TypeId, sub_norm: &NormalizedType, super_norm: &NormalizedType, reason: String, error: Option<TypeError>, )
void Unifier::tryUnifyNormalizedTypes(TypeId subTy, TypeId superTy, const NormalizedType& subNorm, const NormalizedType& superNorm, std::string reason, std::optional<TypeError> error)
Source§impl Unifier
impl Unifier
pub fn unifier_try_unify_primitives(&mut self, sub_ty: TypeId, super_ty: TypeId)
Source§impl Unifier
impl Unifier
Sourcepub fn unifier_try_unify_scalar_shape(
&mut self,
sub_ty: TypeId,
super_ty: TypeId,
reversed: bool,
)
pub fn unifier_try_unify_scalar_shape( &mut self, sub_ty: TypeId, super_ty: TypeId, reversed: bool, )
void Unifier::tryUnifyScalarShape(TypeId subTy, TypeId superTy, bool reversed)
Source§impl Unifier
impl Unifier
pub fn unifier_try_unify_singletons(&mut self, sub_ty: TypeId, super_ty: TypeId)
Source§impl Unifier
impl Unifier
Sourcepub fn unifier_try_unify_tables(
&mut self,
sub_ty: TypeId,
super_ty: TypeId,
is_intersection: bool,
literal_properties: *const LiteralProperties,
)
pub fn unifier_try_unify_tables( &mut self, sub_ty: TypeId, super_ty: TypeId, is_intersection: bool, literal_properties: *const LiteralProperties, )
void Unifier::tryUnifyTables(TypeId subTy, TypeId superTy, bool isIntersection, const LiteralProperties* literalProperties)
Source§impl Unifier
impl Unifier
pub fn unifier_try_unify_type_with_intersection( &mut self, sub_ty: TypeId, super_ty: TypeId, uv: *const IntersectionType, )
Source§impl Unifier
impl Unifier
Sourcepub fn try_unify_type_id_type_id_bool_bool_literal_properties_entry(
&mut self,
sub_ty: TypeId,
super_ty: TypeId,
is_function_call: bool,
is_intersection: bool,
literal_properties: Option<&LiteralProperties>,
)
pub fn try_unify_type_id_type_id_bool_bool_literal_properties_entry( &mut self, sub_ty: TypeId, super_ty: TypeId, is_function_call: bool, is_intersection: bool, literal_properties: Option<&LiteralProperties>, )
void Unifier::tryUnify(TypeId subTy, TypeId superTy, bool isFunctionCall, bool isIntersection, const LiteralProperties* literalProperties)
Source§impl Unifier
impl Unifier
Sourcepub fn try_unify_type_id_type_id_bool_bool_literal_properties(
&mut self,
sub_ty: TypeId,
super_ty: TypeId,
is_function_call: bool,
is_intersection: bool,
literal_properties: Option<&LiteralProperties>,
)
pub fn try_unify_type_id_type_id_bool_bool_literal_properties( &mut self, sub_ty: TypeId, super_ty: TypeId, is_function_call: bool, is_intersection: bool, literal_properties: Option<&LiteralProperties>, )
void Unifier::tryUnify_(TypeId subTy, TypeId superTy, bool isFunctionCall, bool isIntersection, const LiteralProperties* literalProperties)
Source§impl Unifier
impl Unifier
Sourcepub fn try_unify_type_pack_id_type_pack_id_bool_entry(
&mut self,
sub_tp: TypePackId,
super_tp: TypePackId,
is_function_call: bool,
)
pub fn try_unify_type_pack_id_type_pack_id_bool_entry( &mut self, sub_tp: TypePackId, super_tp: TypePackId, is_function_call: bool, )
void Unifier::tryUnify(TypePackId subTp, TypePackId superTp, bool isFunctionCall)
Source§impl Unifier
impl Unifier
Sourcepub fn try_unify_type_pack_id_type_pack_id_bool(
&mut self,
sub_tp: TypePackId,
super_tp: TypePackId,
is_function_call: bool,
)
pub fn try_unify_type_pack_id_type_pack_id_bool( &mut self, sub_tp: TypePackId, super_tp: TypePackId, is_function_call: bool, )
void Unifier::tryUnify_(TypePackId subTp, TypePackId superTp, bool isFunctionCall)
Source§impl Unifier
impl Unifier
Sourcepub fn unifier_try_unify_variadics(
&mut self,
sub_tp: TypePackId,
super_tp: TypePackId,
reversed: bool,
sub_offset: i32,
)
pub fn unifier_try_unify_variadics( &mut self, sub_tp: TypePackId, super_tp: TypePackId, reversed: bool, sub_offset: i32, )
void Unifier::tryUnifyVariadics(TypePackId subTp, TypePackId superTp, bool reversed, int subOffset)