mirror of
https://github.com/roc-lang/roc.git
synced 2024-09-22 08:17:40 +03:00
s/Type::Erroneous/Type::Error
This commit is contained in:
parent
264eeeb2dc
commit
1b38cd0504
@ -391,7 +391,7 @@ pub(crate) fn make_apply_symbol(
|
||||
Err(problem) => {
|
||||
env.problem(roc_problem::can::Problem::RuntimeError(problem));
|
||||
|
||||
Err(Type::Erroneous)
|
||||
Err(Type::Error)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@ -404,7 +404,7 @@ pub(crate) fn make_apply_symbol(
|
||||
|
||||
// A failed import should have already been reported through
|
||||
// roc_can::env::Env::qualified_lookup's checks
|
||||
Err(Type::Erroneous)
|
||||
Err(Type::Error)
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -632,7 +632,7 @@ fn can_annotation_help(
|
||||
type_got: args.len() as u8,
|
||||
alias_kind: alias.kind,
|
||||
});
|
||||
return Type::Erroneous;
|
||||
return Type::Error;
|
||||
}
|
||||
|
||||
let mut type_var_to_arg = Vec::new();
|
||||
@ -722,7 +722,7 @@ fn can_annotation_help(
|
||||
kind: ShadowKind::Variable,
|
||||
});
|
||||
|
||||
return Type::Erroneous;
|
||||
return Type::Error;
|
||||
}
|
||||
};
|
||||
|
||||
@ -989,7 +989,7 @@ fn can_annotation_help(
|
||||
region: Region::across_all(clauses.iter().map(|clause| &clause.region)),
|
||||
});
|
||||
|
||||
Type::Erroneous
|
||||
Type::Error
|
||||
}
|
||||
Malformed(string) => {
|
||||
malformed(env, region, string);
|
||||
@ -1041,13 +1041,13 @@ fn canonicalize_has_clause(
|
||||
&& !scope.abilities_store.is_ability(symbol)
|
||||
{
|
||||
env.problem(roc_problem::can::Problem::HasClauseIsNotAbility { region });
|
||||
return Err(Type::Erroneous);
|
||||
return Err(Type::Error);
|
||||
}
|
||||
symbol
|
||||
}
|
||||
_ => {
|
||||
env.problem(roc_problem::can::Problem::HasClauseIsNotAbility { region });
|
||||
return Err(Type::Erroneous);
|
||||
return Err(Type::Error);
|
||||
}
|
||||
};
|
||||
|
||||
@ -1067,7 +1067,7 @@ fn canonicalize_has_clause(
|
||||
shadow: shadow.clone(),
|
||||
kind: ShadowKind::Variable,
|
||||
});
|
||||
return Err(Type::Erroneous);
|
||||
return Err(Type::Error);
|
||||
}
|
||||
|
||||
let var = var_store.fresh();
|
||||
@ -1093,13 +1093,13 @@ fn can_extension_type<'a>(
|
||||
// Include erroneous types so that we don't overreport errors.
|
||||
matches!(
|
||||
typ,
|
||||
Type::EmptyRec | Type::Record(..) | Type::Variable(..) | Type::Erroneous
|
||||
Type::EmptyRec | Type::Record(..) | Type::Variable(..) | Type::Error
|
||||
)
|
||||
}
|
||||
fn valid_tag_ext_type(typ: &Type) -> bool {
|
||||
matches!(
|
||||
typ,
|
||||
Type::EmptyTagUnion | Type::TagUnion(..) | Type::Variable(..) | Type::Erroneous
|
||||
Type::EmptyTagUnion | Type::TagUnion(..) | Type::Variable(..) | Type::Error
|
||||
)
|
||||
}
|
||||
|
||||
|
@ -3109,7 +3109,7 @@ fn mark_cyclic_alias<'a>(
|
||||
others: Vec<Symbol>,
|
||||
report: bool,
|
||||
) {
|
||||
*typ = Type::Erroneous;
|
||||
*typ = Type::Error;
|
||||
|
||||
if report {
|
||||
let problem = Problem::CyclicAlias(symbol, region, others, alias_kind);
|
||||
|
@ -1332,7 +1332,7 @@ pub enum Type {
|
||||
Variable(Variable),
|
||||
RangedNumber(NumericRange),
|
||||
/// A type error, which will code gen to a runtime error
|
||||
Erroneous,
|
||||
Error,
|
||||
}
|
||||
|
||||
/// A lambda set under an arrow in a ability member signature. For example, in
|
||||
@ -1428,7 +1428,7 @@ impl Clone for Type {
|
||||
Self::Apply(arg0, arg1, arg2) => Self::Apply(*arg0, arg1.clone(), *arg2),
|
||||
Self::Variable(arg0) => Self::Variable(*arg0),
|
||||
Self::RangedNumber(arg1) => Self::RangedNumber(*arg1),
|
||||
Self::Erroneous => Self::Erroneous,
|
||||
Self::Error => Self::Error,
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1544,7 +1544,7 @@ impl fmt::Debug for Type {
|
||||
|
||||
write!(f, ")")
|
||||
}
|
||||
Type::Erroneous => write!(f, "Erroneous"),
|
||||
Type::Error => write!(f, "Erroneous"),
|
||||
Type::DelayedAlias(AliasCommon {
|
||||
symbol,
|
||||
type_arguments,
|
||||
@ -1904,7 +1904,7 @@ impl Type {
|
||||
);
|
||||
}
|
||||
|
||||
EmptyRec | EmptyTagUnion | Erroneous => {}
|
||||
EmptyRec | EmptyTagUnion | Error => {}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2034,7 +2034,7 @@ impl Type {
|
||||
);
|
||||
}
|
||||
|
||||
EmptyRec | EmptyTagUnion | Erroneous => {}
|
||||
EmptyRec | EmptyTagUnion | Error => {}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2137,7 +2137,7 @@ impl Type {
|
||||
}
|
||||
RangedNumber(_) => Ok(()),
|
||||
UnspecializedLambdaSet { .. } => Ok(()),
|
||||
EmptyRec | EmptyTagUnion | ClosureTag { .. } | Erroneous | Variable(_) => Ok(()),
|
||||
EmptyRec | EmptyTagUnion | ClosureTag { .. } | Error | Variable(_) => Ok(()),
|
||||
}
|
||||
}
|
||||
|
||||
@ -2199,7 +2199,7 @@ impl Type {
|
||||
UnspecializedLambdaSet {
|
||||
unspecialized: Uls(_, sym, _),
|
||||
} => *sym == rep_symbol,
|
||||
EmptyRec | EmptyTagUnion | ClosureTag { .. } | Erroneous | Variable(_) => false,
|
||||
EmptyRec | EmptyTagUnion | ClosureTag { .. } | Error | Variable(_) => false,
|
||||
}
|
||||
}
|
||||
|
||||
@ -2255,7 +2255,7 @@ impl Type {
|
||||
.iter()
|
||||
.any(|arg| arg.value.contains_variable(rep_variable)),
|
||||
RangedNumber(_) => false,
|
||||
EmptyRec | EmptyTagUnion | Erroneous => false,
|
||||
EmptyRec | EmptyTagUnion | Error => false,
|
||||
}
|
||||
}
|
||||
|
||||
@ -2517,7 +2517,7 @@ impl Type {
|
||||
} else {
|
||||
if args.len() != alias.type_variables.len() {
|
||||
// We will have already reported an error during canonicalization.
|
||||
*self = Type::Erroneous;
|
||||
*self = Type::Error;
|
||||
return;
|
||||
}
|
||||
|
||||
@ -2629,7 +2629,7 @@ impl Type {
|
||||
}
|
||||
RangedNumber(_) => {}
|
||||
UnspecializedLambdaSet { .. } => {}
|
||||
EmptyRec | EmptyTagUnion | ClosureTag { .. } | Erroneous | Variable(_) => {}
|
||||
EmptyRec | EmptyTagUnion | ClosureTag { .. } | Error | Variable(_) => {}
|
||||
}
|
||||
}
|
||||
|
||||
@ -2765,7 +2765,7 @@ fn symbols_help(initial: &Type) -> Vec<Symbol> {
|
||||
} => {
|
||||
// ignore the member symbol because unspecialized lambda sets are internal-only
|
||||
}
|
||||
EmptyRec | EmptyTagUnion | ClosureTag { .. } | Erroneous | Variable(_) => {}
|
||||
EmptyRec | EmptyTagUnion | ClosureTag { .. } | Error | Variable(_) => {}
|
||||
}
|
||||
}
|
||||
|
||||
@ -2779,7 +2779,7 @@ fn variables_help(tipe: &Type, accum: &mut ImSet<Variable>) {
|
||||
use Type::*;
|
||||
|
||||
match tipe {
|
||||
EmptyRec | EmptyTagUnion | Erroneous => (),
|
||||
EmptyRec | EmptyTagUnion | Error => (),
|
||||
|
||||
Variable(v) => {
|
||||
accum.insert(*v);
|
||||
@ -2909,7 +2909,7 @@ fn variables_help_detailed(tipe: &Type, accum: &mut VariableDetail) {
|
||||
use Type::*;
|
||||
|
||||
match tipe {
|
||||
EmptyRec | EmptyTagUnion | Erroneous => (),
|
||||
EmptyRec | EmptyTagUnion | Error => (),
|
||||
|
||||
Variable(v) => {
|
||||
accum.type_variables.insert(*v);
|
||||
@ -4118,7 +4118,7 @@ fn instantiate_lambda_sets_as_unspecialized(
|
||||
}
|
||||
Type::Variable(_) => {}
|
||||
Type::RangedNumber(_) => {}
|
||||
Type::Erroneous => {}
|
||||
Type::Error => {}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user