use crate::{
core_compiler::{
to_instructions::{ToInstructions, yield_all},
value_visitor::ValueVisitor,
},
instruction::regular_instruction::RegularInstruction,
prelude::*,
runtime::cache::shared_references_cache::SharedReferencesCache,
};
impl<V> ToInstructions for Box<V>
where
V: ToInstructions + ?Sized,
{
fn to_instructions<'a>(
&'a self,
visitor: &'a mut dyn ValueVisitor,
cache: &'a mut SharedReferencesCache,
) -> Box<dyn Iterator<Item = crate::instruction::Instruction> + 'a> {
Box::new(gen move {
yield RegularInstruction::boxed_value().into();
yield_all!((**self).to_instructions(visitor, cache))
})
}
}