Skip to content
Snippets Groups Projects
Commit 1b2f1221 authored by Russel Arbore's avatar Russel Arbore
Browse files

Fix try_array_type

parent 5d7421a0
No related branches found
No related tags found
1 merge request!25Misc. improvements
......@@ -743,15 +743,15 @@ impl Constant {
}
pub fn try_array_type(&self, types: &[Type]) -> Option<TypeID> {
// Need types, since zero initializer may be for a collection type, ro
// Need types, since zero initializer may be for a collection type, or
// not.
match self {
Constant::Array(ty, _) => Some(*ty),
Constant::Zero(ty) => {
if types[ty.idx()].is_primitive() {
None
} else {
if types[ty.idx()].is_array() {
Some(*ty)
} else {
None
}
}
_ => None,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment