This commit is contained in:
Shunsuke Shibayama 2023-04-16 21:13:48 +09:00
parent 62b06022cb
commit 5eb680cb21
5 changed files with 25 additions and 3 deletions

View file

@ -1377,6 +1377,9 @@ impl HasType for Call {
if let Some(attr) = self.attr_name.as_mut() {
Some(attr.ref_mut_t())
} else {
if let Expr::Call(call) = self.obj.as_ref() {
call.return_t()?;
}
Some(self.obj.ref_mut_t())
}
}
@ -1417,6 +1420,14 @@ impl Call {
}
})
}
pub fn return_t(&self) -> Option<&Type> {
if let Some(attr) = self.attr_name.as_ref() {
attr.ref_t().return_t()
} else {
self.obj.ref_t().return_t()
}
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]