mirror of
https://github.com/erg-lang/erg.git
synced 2025-08-03 10:23:20 +00:00
fix: #415
This commit is contained in:
parent
62b06022cb
commit
5eb680cb21
5 changed files with 25 additions and 3 deletions
|
@ -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)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue