Add back Param struct
This commit is contained in:
@@ -708,7 +708,7 @@ impl Function {
|
||||
Some(SelfParam { func: self.id })
|
||||
}
|
||||
|
||||
pub fn params(self, db: &dyn HirDatabase) -> Vec<Type> {
|
||||
pub fn params(self, db: &dyn HirDatabase) -> Vec<Param> {
|
||||
let resolver = self.id.resolver(db.upcast());
|
||||
let ctx = hir_ty::TyLoweringContext::new(db, &resolver);
|
||||
let environment = TraitEnvironment::lower(db, &resolver);
|
||||
@@ -724,7 +724,7 @@ impl Function {
|
||||
environment: environment.clone(),
|
||||
},
|
||||
};
|
||||
ty
|
||||
Param { ty }
|
||||
})
|
||||
.collect()
|
||||
}
|
||||
@@ -754,6 +754,16 @@ impl From<Mutability> for Access {
|
||||
}
|
||||
}
|
||||
|
||||
pub struct Param {
|
||||
ty: Type,
|
||||
}
|
||||
|
||||
impl Param {
|
||||
pub fn ty(&self) -> &Type {
|
||||
&self.ty
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
|
||||
pub struct SelfParam {
|
||||
func: FunctionId,
|
||||
|
||||
Reference in New Issue
Block a user