[valid] allow dynamic access into vectors

This commit is contained in:
Dzmitry Malyshau
2020-09-28 01:41:50 -04:00
committed by Dzmitry Malyshau
parent e57d877dbc
commit 53627c5cd8

View File

@@ -93,6 +93,11 @@ impl Typifier {
Ok(match *expr {
crate::Expression::Access { base, .. } => match *self.get(base, types) {
crate::TypeInner::Array { base, .. } => Resolution::Handle(base),
crate::TypeInner::Vector {
size: _,
kind,
width,
} => Resolution::Value(crate::TypeInner::Scalar { kind, width }),
ref other => panic!("Can't access into {:?}", other),
},
crate::Expression::AccessIndex { base, index } => match *self.get(base, types) {