[msl-out]: avoid inner structure for run-time array sizes

This commit is contained in:
Dzmitry Malyshau
2021-08-16 13:06:53 -04:00
committed by Dzmitry Malyshau
parent ec64eaae6b
commit c398102332

View File

@@ -801,12 +801,15 @@ impl<W: Write> Writer<W> {
crate::TypeInner::ValuePointer { .. } | crate::TypeInner::Vector { .. } => {
write!(self.out, ".{}", back::COMPONENTS[index as usize])?;
}
crate::TypeInner::Matrix { .. } => {
write!(self.out, "[{}]", index)?;
}
crate::TypeInner::Array { .. } => {
crate::TypeInner::Array {
size: crate::ArraySize::Constant(_),
..
} => {
write!(self.out, ".{}[{}]", WRAPPED_ARRAY_FIELD, index)?;
}
crate::TypeInner::Array { .. } | crate::TypeInner::Matrix { .. } => {
write!(self.out, "[{}]", index)?;
}
_ => {
// unexpected indexing, should fail validation
}