Type Alias erg_compiler::error::tycheck::TyCheckError

source ·
pub type TyCheckError = CompileError;

Aliased Type§

struct TyCheckError {
    pub core: Box<ErrorCore>,
    pub input: Input,
    pub caused_by: String,
    pub theme: Theme,
}

Fields§

§core: Box<ErrorCore>§input: Input§caused_by: String§theme: Theme

Implementations§

source§

impl TyCheckError

source

pub fn dummy(input: Input, errno: usize) -> Self

source

pub fn unreachable(input: Input, fn_name: &str, line: u32) -> Self

source

pub fn checker_bug( input: Input, errno: usize, loc: Location, fn_name: &str, line: u32 ) -> Self

source

pub fn no_type_spec_error( input: Input, errno: usize, loc: Location, caused_by: String, name: &str ) -> Self

source

pub fn callable_impl_error<'a, C: Locational + Display>( input: Input, errno: usize, callee: &C, param_ts: impl Iterator<Item = &'a Type>, caused_by: String ) -> Self

source

pub fn type_mismatch_error( input: Input, errno: usize, loc: Location, caused_by: String, name: &str, nth_param: Option<usize>, expect: &Type, found: &Type, candidates: Option<Set<Type>>, hint: Option<String> ) -> Self

source

pub fn return_type_error( input: Input, errno: usize, loc: Location, caused_by: String, name: &str, expect: &Type, found: &Type ) -> Self

source

pub fn uninitialized_error( input: Input, errno: usize, loc: Location, caused_by: String, name: &str, t: &Type ) -> Self

source

pub fn argument_error( input: Input, errno: usize, loc: Location, caused_by: String, expect: usize, found: usize ) -> Self

source

pub fn param_error( input: Input, errno: usize, loc: Location, caused_by: String, expect: usize, found: usize ) -> Self

source

pub fn default_param_error( input: Input, errno: usize, loc: Location, caused_by: String, name: &str ) -> Self

source

pub fn default_param_not_found_error( input: Input, errno: usize, loc: Location, caused_by: String, param_name: &str, similar_name: Option<&str> ) -> Self

source

pub fn match_error( input: Input, errno: usize, loc: Location, caused_by: String, expr_t: &Type, union_pat_t: &Type, arm_ts: Vec<Type> ) -> Self

source

pub fn infer_error( input: Input, errno: usize, loc: Location, caused_by: String, expr: &str ) -> Self

source

pub fn dummy_infer_error(input: Input, fn_name: &str, line: u32) -> Self

source

pub fn not_relation(input: Input, fn_name: &str, line: u32) -> Self

source

pub fn too_many_args_error( input: Input, errno: usize, loc: Location, callee_name: &str, caused_by: String, params_len: usize, pos_args_len: usize, kw_args_len: usize ) -> Self

source

pub fn args_missing_error( input: Input, errno: usize, loc: Location, callee_name: &str, caused_by: String, missing_params: Vec<Str> ) -> Self

source

pub fn multiple_args_error( input: Input, errno: usize, loc: Location, callee_name: &str, caused_by: String, arg_name: &str ) -> Self

source

pub fn unexpected_kw_arg_error( input: Input, errno: usize, loc: Location, callee_name: &str, caused_by: String, param_name: &str, similar_name: Option<&str> ) -> Self

source

pub fn unification_error( input: Input, errno: usize, lhs_t: &Type, rhs_t: &Type, loc: Location, caused_by: String ) -> Self

source

pub fn re_unification_error( input: Input, errno: usize, lhs_t: &Type, rhs_t: &Type, loc: Location, caused_by: String ) -> Self

source

pub fn subtyping_error( input: Input, errno: usize, sub_t: &Type, sup_t: &Type, loc: Location, caused_by: String ) -> Self

source

pub fn invariant_error( input: Input, errno: usize, sub_t: &Type, sup_t: &Type, loc: Location, caused_by: String ) -> Self

source

pub fn pred_unification_error( input: Input, errno: usize, sub_pred: &Predicate, super_pred: &Predicate, loc: Location, caused_by: String ) -> Self

source

pub fn no_candidate_error( input: Input, errno: usize, proj: &Type, loc: Location, caused_by: String, hint: Option<String> ) -> Self

source

pub fn no_trait_impl_error( input: Input, errno: usize, class: &Type, trait_: &Type, loc: Location, caused_by: String, hint: Option<String> ) -> Self

source

pub fn method_definition_error( input: Input, errno: usize, loc: Location, caused_by: String, name: &str, hint: Option<String> ) -> Self

source

pub fn specialization_error( _input: Input, _errno: usize, _loc: Location, _caused_by: String, _member_name: &str, _base_trait_type: &Type, _expect: &Type, _found: &Type ) -> Self

source

pub fn trait_member_type_error( input: Input, errno: usize, loc: Location, caused_by: String, member_name: &str, trait_type: &Type, expect: &Type, found: &Type, hint: Option<String> ) -> Self

source

pub fn trait_member_not_defined_error( input: Input, errno: usize, caused_by: String, member_name: &str, trait_type: &Type, class_type: &Type, hint: Option<String>, loc: Location ) -> Self

source

pub fn not_in_trait_error( input: Input, errno: usize, caused_by: String, member_name: &str, trait_type: &Type, class_type: &Type, hint: Option<String>, loc: Location ) -> Self

source

pub fn tyvar_not_defined_error( input: Input, errno: usize, name: &str, loc: Location, caused_by: String ) -> Self

source

pub fn ambiguous_type_error( input: Input, errno: usize, expr: &(impl Locational + Display), candidates: &[Type], caused_by: String ) -> Self

source

pub fn ambiguous_method_error( input: Input, errno: usize, receiver: &(impl Locational + NoTypeDisplay), attr: &(impl Locational + Display), candidates: &[Type], caused_by: String ) -> Self

source

pub fn tp_to_type_error( input: Input, errno: usize, tp: &TyParam, loc: Location, caused_by: String ) -> Self

source

pub fn implicit_widening_error( input: Input, errno: usize, loc: Location, caused_by: String, before: &Type, after: &Type ) -> Self

source

pub fn overload_error<'a>( input: Input, errno: usize, loc: Location, caused_by: String, pos_args: Vec<ParamTy>, kw_args: Vec<ParamTy>, found: impl Iterator<Item = &'a Type> ) -> Self

source

pub fn self_type_error( input: Input, errno: usize, loc: Location, caused_by: String ) -> Self