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"),
|
TypedHole(_) => Stmt::RuntimeError("Hit a blank"),
|
||||||
RuntimeError(e) => Stmt::RuntimeError(env.arena.alloc(e.runtime_message())),
|
RuntimeError(e) => Stmt::RuntimeError(env.arena.alloc(e.runtime_message())),
|
||||||
Crash { msg, ret_var: _ } => {
|
Crash { msg, ret_var: _ } => {
|
||||||
let msg_sym = env.unique_symbol();
|
let msg_sym = possible_reuse_symbol_or_specialize(
|
||||||
let stmt = Stmt::Crash(msg_sym, CrashTag::User);
|
|
||||||
|
|
||||||
with_hole(
|
|
||||||
env,
|
env,
|
||||||
msg.value,
|
|
||||||
Variable::STR,
|
|
||||||
procs,
|
procs,
|
||||||
layout_cache,
|
layout_cache,
|
||||||
msg_sym,
|
&msg.value,
|
||||||
env.arena.alloc(stmt),
|
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