First attempt at generic type inference for fns

This commit is contained in:
Marcus Klaas de Vries 2019-01-25 21:16:02 +01:00
parent 3f4f50baaa
commit 3bd47c0285
6 changed files with 81 additions and 21 deletions

View file

@ -388,7 +388,7 @@ pub use crate::code_model_impl::function::ScopeEntryWithSyntax;
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct FnSignature {
pub(crate) name: Name,
pub(crate) params: Vec<TypeRef>,
pub(crate) args: Vec<TypeRef>,
pub(crate) ret_type: TypeRef,
/// True if the first param is `self`. This is relevant to decide whether this
/// can be called as a method.
@ -400,8 +400,8 @@ impl FnSignature {
&self.name
}
pub fn params(&self) -> &[TypeRef] {
&self.params
pub fn args(&self) -> &[TypeRef] {
&self.args
}
pub fn ret_type(&self) -> &TypeRef {