protospec_build/semantics/convert/expression/
array_index.rs

1use super::*;
2
3impl Scope {
4    pub(super) fn convert_array_index_expression(
5        self_: &Arc<RefCell<Scope>>,
6        expr: &ast::ArrayIndexExpression,
7        expected_type: PartialType,
8    ) -> AsgResult<ArrayIndexExpression> {
9        Ok(ArrayIndexExpression {
10            array: Box::new(Scope::convert_expr(
11                self_,
12                &expr.array,
13                PartialType::Array(Some(Box::new(expected_type))),
14            )?),
15            index: Box::new(Scope::convert_expr(
16                self_,
17                &expr.index,
18                Type::Scalar(ScalarType::U64).into(),
19            )?),
20            span: expr.span,
21        })
22    }
23}