This commit is contained in:
Folkert 2020-11-02 20:28:12 +01:00
parent eedf746ec7
commit 841d696e6d
3 changed files with 22 additions and 4 deletions

View file

@ -788,4 +788,18 @@ mod gen_num {
// f64 // f64
// ); // );
// } // }
#[test]
fn num_max_int() {
assert_evals_to!(
indoc!(
r#"
# Num.maxInt
Num.add (-1) Num.maxInt
"#
),
1,
i64
);
}
} }

View file

@ -1505,6 +1505,7 @@ fn update<'a>(
{ {
// state.timings.insert(module_id, module_timing); // state.timings.insert(module_id, module_timing);
dbg!(&state.procedures);
Proc::insert_refcount_operations(arena, &mut state.procedures); Proc::insert_refcount_operations(arena, &mut state.procedures);
msg_tx msg_tx

View file

@ -2031,9 +2031,6 @@ pub fn with_hole<'a>(
} }
} }
} }
// Var(symbol) => panic!("reached Var {}", symbol),
// assigned,
// Stmt::Ret(symbol),
Tag { Tag {
variant_var, variant_var,
name: tag_name, name: tag_name,
@ -4110,7 +4107,13 @@ fn reuse_function_symbol<'a>(
original: Symbol, original: Symbol,
) -> Stmt<'a> { ) -> Stmt<'a> {
match procs.partial_procs.get(&original) { match procs.partial_procs.get(&original) {
None => result, None => {
if original.module_id() != env.home && original.module_id() != ModuleId::ATTR {
result
} else {
result
}
}
Some(partial_proc) => { Some(partial_proc) => {
let arg_var = arg_var.unwrap_or(partial_proc.annotation); let arg_var = arg_var.unwrap_or(partial_proc.annotation);
// this symbol is a function, that is used by-name (e.g. as an argument to another // this symbol is a function, that is used by-name (e.g. as an argument to another