fn function(&self, function: &DirectName, pos: &Position) -> Result<Function, Vec<TypeErr>> {
        let generics = HashMap::new();

        if let Some(generic_fun) = self.functions.iter().find(|c| &c.name == function) {
            Function::try_from((generic_fun, &generics, pos))
        } else if let Some(generic_class) = self.classes.iter().find(|c| &c.name == function) {
            let class = Class::try_from((generic_class, &generics, pos))?;
            class.constructor(true)
        } else {
            let msg = format!("Function {} is undefined.", function);
            Err(vec![TypeErr::new(pos, &msg)])
        }
    }
/// Look up a function and substitutes generics to yield a Function.
///
/// If function does not exist, treat function as constructor and see if
/// there exists a class with the same name.
Look up a function and substitutes generics to yield a Function.
If function does not exist, treat function as constructor and see if
there exists a class with the same name.
Look up a function and substitutes generics to yield a Function . If function does not exist treat function as constructor and see if there exists a class with the same name .
fn function(&self, function: &DirectName, pos: &Position) -> Result<Function, Vec<TypeErr>> {
        let generics = HashMap::new();
        if let Some(generic_fun) = self.functions.iter().find(|c| &c.name == function) {
            Function::try_from((generic_fun, &generics, pos))
        } else if let Some(generic_class) = self.classes.iter().find(|c| &c.name == function) {
            let class = Class::try_from((generic_class, &generics, pos))?;
            class.constructor(true)
        } else {
            let msg = format!("Function {} is undefined.", function);
            Err(vec![TypeErr::new(pos, &msg)])
        }
    }
fn function ( & self , function : & DirectName , pos : & Position ) -> Result < Function , Vec < TypeErr > > { let generics = HashMap :: new ( ) ; if let Some ( generic_fun ) = self . functions . iter ( ) . find ( | c | & c . name == function ) { Function :: try_from ( ( generic_fun , & generics , pos ) ) } else if let Some ( generic_class ) = self . classes . iter ( ) . find ( | c | & c . name == function ) { let class = Class :: try_from ( ( generic_class , & generics , pos ) ) ? ; class . constructor ( true ) } else { let msg = format ! ( " " function ) ; Err ( vec ! [ TypeErr new ( pos msg ) ] ) } }
Look up a function and substitutes generics to yield a Function.
Look up a function and substitutes generics to yield a Function .
&self
function
&DirectName
pos
&Position