mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 21:39:07 +00:00
fix bug with dynamic size calls (copy structs now work)
This commit is contained in:
parent
e19b272a9e
commit
66f9ff1d58
2 changed files with 6 additions and 3 deletions
|
@ -153,15 +153,19 @@ impl<'a> ReplApp<'a> for ExpectReplApp<'a> {
|
||||||
fn call_function_dynamic_size<T, F>(
|
fn call_function_dynamic_size<T, F>(
|
||||||
&mut self,
|
&mut self,
|
||||||
_main_fn_name: &str,
|
_main_fn_name: &str,
|
||||||
ret_bytes: usize,
|
_ret_bytes: usize,
|
||||||
transform: F,
|
transform: F,
|
||||||
) -> T
|
) -> T
|
||||||
where
|
where
|
||||||
F: Fn(&'a Self::Memory, usize) -> T,
|
F: Fn(&'a Self::Memory, usize) -> T,
|
||||||
Self::Memory: 'a,
|
Self::Memory: 'a,
|
||||||
{
|
{
|
||||||
|
*self.memory.bytes_read.borrow_mut() = 0;
|
||||||
|
|
||||||
let result = transform(self.memory, self.offset);
|
let result = transform(self.memory, self.offset);
|
||||||
self.offset += ret_bytes;
|
|
||||||
|
self.offset += *self.memory.bytes_read.borrow();
|
||||||
|
|
||||||
result
|
result
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -410,7 +410,6 @@ mod test {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[ignore]
|
|
||||||
fn lookup_copy_record() {
|
fn lookup_copy_record() {
|
||||||
run_expect_test(
|
run_expect_test(
|
||||||
indoc!(
|
indoc!(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue