Add type params to FnSignature

This commit is contained in:
Marcus Klaas de Vries 2019-01-26 00:30:56 +01:00
parent 67e40e431a
commit aa06893a14
9 changed files with 106 additions and 136 deletions

View file

@ -388,6 +388,7 @@ pub use crate::code_model_impl::function::ScopeEntryWithSyntax;
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct FnSignature {
pub(crate) name: Name,
pub(crate) type_params: Arc<GenericParams>,
pub(crate) args: Vec<TypeRef>,
pub(crate) ret_type: TypeRef,
/// True if the first param is `self`. This is relevant to decide whether this
@ -413,6 +414,10 @@ impl FnSignature {
pub fn has_self_param(&self) -> bool {
self.has_self_param
}
pub fn generics(&self) -> &GenericParams {
&self.type_params
}
}
impl Function {