Skip to main content

Unifier

Struct Unifier 

Source
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§shared_state: *mut UnifierSharedState§blocked_types: Vec<TypeId>§blocked_type_packs: Vec<TypePackId>§first_pack_error_pos: Option<i32>

Implementations§

Source§

impl Unifier

Source

pub fn unifier_cache_result( &mut self, sub_ty: TypeId, super_ty: TypeId, prev_error_count: usize, )

Source§

impl Unifier

Source

pub fn unifier_can_cache_result( &mut self, sub_ty: TypeId, super_ty: TypeId, ) -> bool

Source§

impl Unifier

Source

pub fn can_unify_type_id_type_id( &mut self, sub_ty: TypeId, super_ty: TypeId, ) -> ErrorVec

Source§

impl Unifier

Source

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

Source

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

Source

pub fn check_child_unifier_type_mismatch_error_vec_string_type_id_type_id( &mut self, inner_errors: &ErrorVec, prop: &str, wanted_type: TypeId, given_type: TypeId, )

Source§

impl Unifier

Source

pub fn unifier_combine_logs_into_union( &mut self, logs: Vec<TxnLog>, arena: *mut TypeArena, ) -> TxnLog

Source§

impl Unifier

Source

pub fn unifier_deeply_optional( &mut self, ty: TypeId, seen: &mut HashMap<TypeId, TypeId>, ) -> TypeId

Source§

impl Unifier

Source§

impl Unifier

Source

pub fn ice_string_location(&mut self, message: &str, location: &Location)

Source§

impl Unifier

Source

pub fn ice_string(&mut self, message: &str)

Source§

impl Unifier

Source§

impl Unifier

Source§

impl Unifier

Source

pub fn occurs_check_type_id_type_id_bool( &mut self, needle: TypeId, haystack: TypeId, reversed: bool, ) -> bool

bool Unifier::occursCheck(TypeId needle, TypeId haystack, bool reversed)

Source§

impl Unifier

Source

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

Source

pub fn occurs_check_type_pack_id_type_pack_id_bool( &mut self, needle: TypePackId, haystack: TypePackId, _reversed: bool, ) -> bool

Source§

impl Unifier

Source§

impl Unifier

Source§

impl Unifier

Source§

impl Unifier

Source

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

Source

pub fn unifier_try_unify_functions( &mut self, sub_ty: TypeId, super_ty: TypeId, is_function_call: bool, )

Source§

impl Unifier

Source

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

Source

pub fn unifier_try_unify_negations(&mut self, sub_ty: TypeId, super_ty: TypeId)

Source§

impl Unifier

Source

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

Source

pub fn unifier_try_unify_primitives(&mut self, sub_ty: TypeId, super_ty: TypeId)

Source§

impl Unifier

Source

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

Source

pub fn unifier_try_unify_singletons(&mut self, sub_ty: TypeId, super_ty: TypeId)

Source§

impl Unifier

Source

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

Source§

impl Unifier

Source

pub fn unifier_try_unify_type_with_union( &mut self, sub_ty: TypeId, super_ty: TypeId, uv: *const UnionType, cache_enabled: bool, is_function_call: bool, )

Source§

impl Unifier

Source

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

Source

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

Source

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

Source

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

Source

pub fn unifier_try_unify_union_with_type( &mut self, sub_ty: TypeId, sub_union: *const UnionType, super_ty: TypeId, )

void Unifier::tryUnifyUnionWithType(TypeId subTy, const UnionType* subUnion, TypeId superTy)

Source§

impl Unifier

Source

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)

Source§

impl Unifier

Source

pub fn try_unify_with_any_type_id_type_id( &mut self, sub_ty: TypeId, any_ty: TypeId, )

Source§

impl Unifier

Source§

impl Unifier

Source

pub fn unifier_try_unify_with_extern_type( &mut self, sub_ty: TypeId, super_ty: TypeId, reversed: bool, )

Source§

impl Unifier

Source

pub fn unifier_try_unify_with_metatable( &mut self, sub_ty: TypeId, super_ty: TypeId, reversed: bool, )

Source§

impl Unifier

Source

pub fn unifier_unifier( _normalizer: *mut Normalizer, _scope: *mut Scope, _location: &Location, _variance: Variance, _parent_log: *mut TxnLog, )

Trait Implementations§

Source§

impl Debug for Unifier

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.