refactor(tvix/eval): let OpCoerceToString select the CoercionKind

Change-Id: I92d58ef216d7e0766af70f019b3dcd445284a95d
Reviewed-on: https://cl.tvl.fyi/c/depot/+/10344
Reviewed-by: tazjin <tazjin@tvl.su>
Tested-by: BuildkiteCI
This commit is contained in:
Adam Joseph 2023-12-12 20:47:31 -08:00 committed by tazjin
parent 0c22454bb9
commit 11e35a77a6
4 changed files with 13 additions and 15 deletions

View file

@ -777,20 +777,13 @@ impl<'o> VM<'o> {
_ => panic!("attempted to finalise a non-thunk"),
},
OpCode::OpCoerceToString => {
OpCode::OpCoerceToString(kind) => {
let value = self.stack_pop();
let gen_span = frame.current_light_span();
self.push_call_frame(span, frame);
self.enqueue_generator("coerce_to_string", gen_span.clone(), |co| {
value.coerce_to_string(
co,
CoercionKind {
strong: false,
import_paths: true,
},
gen_span,
)
value.coerce_to_string(co, kind, gen_span)
});
return Ok(false);