fn into_type_params(
        &self,
        node: Node_<'a>,
    ) -> Result<(&'a [Tparam<'a>], SortedSet<'a, &'a str>), ParseError> {
        let mut type_variables = MultiSetMut::new_in(self.state.arena);
        let type_params = self.map_to_slice(Ok(node), |node| {
            let TypeParameterDecl {
                name,
                variance,
                reified,
                constraints,
            } = match node {
                Node_::TypeParameter(decl) => decl,
                n => return Err(format!("Expected a type parameter, but got {:?}", n)),
            };
            let id = self.get_name("", *name)?;
            let constraints_iter = constraints.iter();
            let mut constraints = Vec::new_in(self.state.arena);
            for constraint in constraints_iter {
                let (kind, value) = *constraint;
                constraints.push((kind, self.node_to_ty(value, SSet::from_slice(&[]))?));
            }
            let constraints = constraints.into_bump_slice();
            type_variables.insert(id.1);
            Ok(Tparam {
                variance: *variance,
                name: id,
                constraints,
                reified: *reified,
                user_attributes: &[],
            })
        })?;
        Ok((type_params, type_variables.into()))
    }
/// Converts any node that can represent a list of Node_::TypeParameter
/// into the type parameter list and a list of all type variables. Used for
/// classes, methods, and functions.
Converts any node that can represent a list of Node_::TypeParameter
into the type parameter list and a list of all type variables. Used for
classes, methods, and functions.
Converts any node that can represent a list of Node_ :: TypeParameter into the type parameter list and a list of all type variables . Used for classes methods and functions .
fn into_type_params(
        &self,
        node: Node_<'a>,
    ) -> Result<(&'a [Tparam<'a>], SortedSet<'a, &'a str>), ParseError> {
        let mut type_variables = MultiSetMut::new_in(self.state.arena);
        let type_params = self.map_to_slice(Ok(node), |node| {
            let TypeParameterDecl {
                name,
                variance,
                reified,
                constraints,
            } = match node {
                Node_::TypeParameter(decl) => decl,
                n => return Err(format!("Expected a type parameter, but got {:?}", n)),
            };
            let id = self.get_name("", *name)?;
            let constraints_iter = constraints.iter();
            let mut constraints = Vec::new_in(self.state.arena);
            for constraint in constraints_iter {
                let (kind, value) = *constraint;
                constraints.push((kind, self.node_to_ty(value, SSet::from_slice(&[]))?));
            }
            let constraints = constraints.into_bump_slice();
            type_variables.insert(id.1);
            Ok(Tparam {
                variance: *variance,
                name: id,
                constraints,
                reified: *reified,
                user_attributes: &[],
            })
        })?;
        Ok((type_params, type_variables.into()))
    }
fn into_type_params ( & self , node : Node_ < ' a > , ) -> Result < ( & ' a [ Tparam < ' a > ] , SortedSet < ' a , & ' a str > ) , ParseError > { let mut type_variables = MultiSetMut :: new_in ( self . state . arena ) ; let type_params = self . map_to_slice ( Ok ( node ) , | node | { let TypeParameterDecl { name , variance , reified , constraints , } = match node { Node_ :: TypeParameter ( decl ) => decl , n => return Err ( format ! ( " " n ) ) , } ; let id = self . get_name ( " " , * name ) ? ; let constraints_iter = constraints . iter ( ) ; let mut constraints = Vec :: new_in ( self . state . arena ) ; for constraint in constraints_iter { let ( kind , value ) = * constraint ; constraints . push ( ( kind , self . node_to_ty ( value , SSet :: from_slice ( & [ ] ) ) ? ) ) ; } let constraints = constraints . into_bump_slice ( ) ; type_variables . insert ( id . 1 ) ; Ok ( Tparam { variance : * variance , name : id , constraints , reified : * reified , user_attributes : & [ ] , } ) } ) ? ; Ok ( ( type_params , type_variables . into ( ) ) ) }
Converts any node that can represent a list of Node_::TypeParameter
into the type parameter list and a list of all type variables.
Converts any node that can represent a list of Node_ :: TypeParameter into the type parameter list and a list of all type variables .
&self
node
Node_<'a>