pub fn resolve_ty_shallow<'b>(&mut self, ty: &'b Ty) -> Cow<'b, Ty> {
        let mut ty = Cow::Borrowed(ty);
        // The type variable could resolve to a int/float variable. Hence try
        // resolving up to three times; each type of variable shouldn't occur
        // more than once
        for i in 0..3 {
            if i > 0 {
                tested_by!(type_var_resolves_to_int_var);
            }
            match &*ty {
                Ty::Infer(tv) => {
                    let inner = tv.to_inner();
                    match self.var_unification_table.inlined_probe_value(inner).known() {
                        Some(known_ty) => {
                            // The known_ty can't be a type var itself
                            ty = Cow::Owned(known_ty.clone());
                        }
                        _ => return ty,
                    }
                }
                _ => return ty,
            }
        }
        log::error!("Inference variable still not resolved: {:?}", ty);
        ty
    }
/// If `ty` is a type variable with known type, returns that type;
/// otherwise, return ty.
If `ty` is a type variable with known type, returns that type;
otherwise, return ty.
If ` ty ` is a type variable with known type returns that type ; otherwise return ty .
pub fn resolve_ty_shallow<'b>(&mut self, ty: &'b Ty) -> Cow<'b, Ty> {
        let mut ty = Cow::Borrowed(ty);
        // The type variable could resolve to a int/float variable. Hence try
        // resolving up to three times; each type of variable shouldn't occur
        // more than once
        for i in 0..3 {
            if i > 0 {
                tested_by!(type_var_resolves_to_int_var);
            }
            match &*ty {
                Ty::Infer(tv) => {
                    let inner = tv.to_inner();
                    match self.var_unification_table.inlined_probe_value(inner).known() {
                        Some(known_ty) => {
                            // The known_ty can't be a type var itself
                            ty = Cow::Owned(known_ty.clone());
                        }
                        _ => return ty,
                    }
                }
                _ => return ty,
            }
        }
        log::error!("Inference variable still not resolved: {:?}", ty);
        ty
    }
pub fn resolve_ty_shallow < ' b > ( & mut self , ty : & ' b Ty ) -> Cow < ' b , Ty > { let mut ty = Cow :: Borrowed ( ty ) ; // The type variable could resolve to a int/float variable. Hence try // resolving up to three times; each type of variable shouldn't occur // more than once for i in 0 .. 3 { if i > 0 { tested_by ! ( type_var_resolves_to_int_var ) ; } match & * ty { Ty :: Infer ( tv ) => { let inner = tv . to_inner ( ) ; match self . var_unification_table . inlined_probe_value ( inner ) . known ( ) { Some ( known_ty ) => { // The known_ty can't be a type var itself ty = Cow :: Owned ( known_ty . clone ( ) ) ; } _ => return ty , } } _ => return ty , } } log :: error ! ( " " ty ) ; ty }
If `ty` is a type variable with known type, returns that type;
otherwise, return ty.
If ` ty ` is a type variable with known type returns that type ; otherwise return ty .
&mut self
ty
&'b Ty