pub fn typeck_array_aggregate_choice<'sbc, 'lazy: 'sbc, 'sb: 'lazy, 'ast: 'sb, 'ctx: 'sb>(
    tyc: &TypeckContext<'sbc, 'lazy, 'sb, 'ast, 'ctx>,
    hir: &Spanned<hir::ArrayChoice>,
    index_ty: &'ctx Ty,
) -> Result<()> {
    match hir.value {
        hir::ArrayChoice::Expr(expr_id) => {
            tyc.ctx.set_type_context(expr_id, index_ty);
            let ty = tyc.lazy_typeval(expr_id)?;
            tyc.must_match(index_ty, ty, hir.span);
        }
        hir::ArrayChoice::DiscreteRange(hir::DiscreteRange::Subtype(subtype_id)) => {
            let ty = tyc.lazy_typeval(subtype_id)?;
            tyc.must_match(index_ty, ty, hir.span);
        }
        hir::ArrayChoice::DiscreteRange(hir::DiscreteRange::Range(ref _range)) => {
            // TODO: Check type.
        }
    }
    Ok(())
}
/// Check the type of an array aggregate choice.
Check the type of an array aggregate choice.
Check the type of an array aggregate choice .
pub fn typeck_array_aggregate_choice<'sbc, 'lazy: 'sbc, 'sb: 'lazy, 'ast: 'sb, 'ctx: 'sb>(
    tyc: &TypeckContext<'sbc, 'lazy, 'sb, 'ast, 'ctx>,
    hir: &Spanned<hir::ArrayChoice>,
    index_ty: &'ctx Ty,
) -> Result<()> {
    match hir.value {
        hir::ArrayChoice::Expr(expr_id) => {
            tyc.ctx.set_type_context(expr_id, index_ty);
            let ty = tyc.lazy_typeval(expr_id)?;
            tyc.must_match(index_ty, ty, hir.span);
        }
        hir::ArrayChoice::DiscreteRange(hir::DiscreteRange::Subtype(subtype_id)) => {
            let ty = tyc.lazy_typeval(subtype_id)?;
            tyc.must_match(index_ty, ty, hir.span);
        }
        hir::ArrayChoice::DiscreteRange(hir::DiscreteRange::Range(ref _range)) => {
            // TODO: Check type.
        }
    }
    Ok(())
}
pub fn typeck_array_aggregate_choice < ' sbc , ' lazy : ' sbc , ' sb : ' lazy , ' ast : ' sb , ' ctx : ' sb > ( tyc : & TypeckContext < ' sbc , ' lazy , ' sb , ' ast , ' ctx > , hir : & Spanned < hir :: ArrayChoice > , index_ty : & ' ctx Ty , ) -> Result < ( ) > { match hir . value { hir :: ArrayChoice :: Expr ( expr_id ) => { tyc . ctx . set_type_context ( expr_id , index_ty ) ; let ty = tyc . lazy_typeval ( expr_id ) ? ; tyc . must_match ( index_ty , ty , hir . span ) ; } hir :: ArrayChoice :: DiscreteRange ( hir :: DiscreteRange :: Subtype ( subtype_id ) ) => { let ty = tyc . lazy_typeval ( subtype_id ) ? ; tyc . must_match ( index_ty , ty , hir . span ) ; } hir :: ArrayChoice :: DiscreteRange ( hir :: DiscreteRange :: Range ( ref _range ) ) => { // TODO: Check type. } } Ok ( ( ) ) }
Check the type of an array aggregate choice.
Check the type of an array aggregate choice .
tyc
&TypeckContext<'sbc, 'lazy, 'sb, 'ast, 'ctx>
hir
&Spanned<hir::ArrayChoice>
index_ty
&'ctx Ty
tyc
&TypeckContext<'sbc, 'lazy, 'sb, 'ast, 'ctx>
hir
&Spanned<hir::ArrayChoice>
index_ty
&'ctx Ty