Closed wichert closed 1 month ago
The generated code looks like this:
self.children = vec![Default::default(); children_array_length];
for element in &mut self.children {
element.num_index_bits = self.num_vertices().clone() as u64;
}
The best fix here is probably to do something like this:
self.children = vec![
ParametrizedChild{
num_index_bits: self.num_vertices().clone() as u64,
..Default::default()
}; children_array_length];
That solution will fail for cases where @index
operator is used, such as in this test:
struct IndexTest
{
uint16 numBlocks;
BlockHeader headers[numBlocks];
Block(headers[@index]) blocks[numBlocks];
};
fixed with #119
Using a function call for a parameterized type results in code that does not compile. This is a minimal example:
Which results in: