mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-29 14:54:47 +00:00
Correct symbol capturing of crash
This commit is contained in:
parent
220c8a8e64
commit
d9a8cba821
1 changed files with 7 additions and 9 deletions
|
@ -5571,18 +5571,16 @@ pub fn with_hole<'a>(
|
|||
TypedHole(_) => Stmt::RuntimeError("Hit a blank"),
|
||||
RuntimeError(e) => Stmt::RuntimeError(env.arena.alloc(e.runtime_message())),
|
||||
Crash { msg, ret_var: _ } => {
|
||||
let msg_sym = env.unique_symbol();
|
||||
let stmt = Stmt::Crash(msg_sym, CrashTag::User);
|
||||
|
||||
with_hole(
|
||||
let msg_sym = possible_reuse_symbol_or_specialize(
|
||||
env,
|
||||
msg.value,
|
||||
Variable::STR,
|
||||
procs,
|
||||
layout_cache,
|
||||
msg_sym,
|
||||
env.arena.alloc(stmt),
|
||||
)
|
||||
&msg.value,
|
||||
Variable::STR,
|
||||
);
|
||||
let stmt = Stmt::Crash(msg_sym, CrashTag::User);
|
||||
|
||||
assign_to_symbol(env, procs, layout_cache, Variable::STR, *msg, msg_sym, stmt)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue