Use Variable::U64 over Variable::NAT

This commit is contained in:
Richard Feldman 2024-01-24 23:29:23 -05:00
parent eb3dc3d582
commit 2b4d0d080b
No known key found for this signature in database
GPG key ID: F1F21AA5B1D9E43B

View file

@ -639,8 +639,8 @@ fn step_elem(
WhenBranch { WhenBranch {
patterns: vec![WhenBranchPattern { patterns: vec![WhenBranchPattern {
pattern: Loc::at_zero(Pattern::IntLiteral( pattern: Loc::at_zero(Pattern::IntLiteral(
Variable::NAT, Variable::U64,
Variable::NATURAL, Variable::UNSIGNED64,
index.to_string().into_boxed_str(), index.to_string().into_boxed_str(),
IntValue::I128((index as i128).to_ne_bytes()), IntValue::I128((index as i128).to_ne_bytes()),
IntBound::Exact(IntLitWidth::U64), IntBound::Exact(IntLitWidth::U64),
@ -676,12 +676,12 @@ fn step_elem(
// when index is // when index is
let body = Expr::When { let body = Expr::When {
loc_cond: Box::new(Loc::at_zero(Expr::Var(index_arg_symbol, Variable::NAT))), loc_cond: Box::new(Loc::at_zero(Expr::Var(index_arg_symbol, Variable::U64))),
cond_var: Variable::NAT, cond_var: Variable::U64,
expr_var: keep_or_skip_var, expr_var: keep_or_skip_var,
region: Region::zero(), region: Region::zero(),
branches, branches,
branches_cond_var: Variable::NAT, branches_cond_var: Variable::U64,
exhaustive: ExhaustiveMark::known_exhaustive(), exhaustive: ExhaustiveMark::known_exhaustive(),
}; };
@ -699,7 +699,7 @@ fn step_elem(
}; };
{ {
let args_slice = SubsSlice::insert_into_subs(env.subs, [state_record_var, Variable::NAT]); let args_slice = SubsSlice::insert_into_subs(env.subs, [state_record_var, Variable::U64]);
env.subs.set_content( env.subs.set_content(
function_type, function_type,
@ -721,7 +721,7 @@ fn step_elem(
Loc::at_zero(Pattern::Identifier(state_arg_symbol)), Loc::at_zero(Pattern::Identifier(state_arg_symbol)),
), ),
( (
Variable::NAT, Variable::U64,
AnnotatedMark::known_exhaustive(), AnnotatedMark::known_exhaustive(),
Loc::at_zero(Pattern::Identifier(index_arg_symbol)), Loc::at_zero(Pattern::Identifier(index_arg_symbol)),
), ),