Type Definition erg_compiler::error::tycheck::TyCheckError

source ·
pub type TyCheckError = CompileError;

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 match_error(
    input: Input,
    errno: usize,
    loc: Location,
    caused_by: String,
    expr_t: &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
) -> 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 pred_unification_error(
    input: Input,
    errno: usize,
    lhs: &Predicate,
    rhs: &Predicate,
    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 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>
) -> 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>
) -> 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