pub fn gen_collection_lookup(
    lookup: &AST,
    col: &AST,
    env: &Environment,
    constr: &mut ConstrBuilder
) -> Constrained {
    let (mut env, mut vars) = (env.clone(), vec![]);
    for (mutable, var) in Identifier::try_from(lookup)?.fields() {
        vars.push(var.clone());
        env = env.insert_var(mutable, &var, &Expected::new(&lookup.pos, &ExpressionAny));
    }

    constr.add_with_identifier(
        "collection lookup",
        &Expected::new(&lookup.pos, &Collection { ty: Box::from(Expected::try_from(lookup)?) }),
        &Expected::try_from(col)?,
        &vars
    );

    Ok((constr.clone(), env))
}
/// Constrain lookup an collection.
///
/// This is done by constraining the given expected collection with an expected
/// collection with the lookup parameter. Therefore, the type of the lookup, and
/// the type of the given collection's parameter must be the same.
Constrain lookup an collection.
This is done by constraining the given expected collection with an expected
collection with the lookup parameter. Therefore, the type of the lookup, and
the type of the given collection's parameter must be the same.
Constrain lookup an collection . This is done by constraining the given expected collection with an expected collection with the lookup parameter . Therefore the type of the lookup and the type of the given collection ' s parameter must be the same .
pub fn gen_collection_lookup(
    lookup: &AST,
    col: &AST,
    env: &Environment,
    constr: &mut ConstrBuilder
) -> Constrained {
    let (mut env, mut vars) = (env.clone(), vec![]);
    for (mutable, var) in Identifier::try_from(lookup)?.fields() {
        vars.push(var.clone());
        env = env.insert_var(mutable, &var, &Expected::new(&lookup.pos, &ExpressionAny));
    }
    constr.add_with_identifier(
        "collection lookup",
        &Expected::new(&lookup.pos, &Collection { ty: Box::from(Expected::try_from(lookup)?) }),
        &Expected::try_from(col)?,
        &vars
    );
    Ok((constr.clone(), env))
}
pub fn gen_collection_lookup ( lookup : & AST , col : & AST , env : & Environment , constr : & mut ConstrBuilder ) -> Constrained { let ( mut env , mut vars ) = ( env . clone ( ) , vec ! [ ] ) ; for ( mutable , var ) in Identifier :: try_from ( lookup ) ? . fields ( ) { vars . push ( var . clone ( ) ) ; env = env . insert_var ( mutable , & var , & Expected :: new ( & lookup . pos , & ExpressionAny ) ) ; } constr . add_with_identifier ( " " , & Expected :: new ( & lookup . pos , & Collection { ty : Box :: from ( Expected :: try_from ( lookup ) ? ) } ) , & Expected :: try_from ( col ) ? , & vars ) ; Ok ( ( constr . clone ( ) , env ) ) }
Constrain lookup an collection.
Constrain lookup an collection .
lookup
&AST
col
&AST
env
&Environment
constr
&mut ConstrBuilder