mirror of
https://github.com/erg-lang/erg.git
synced 2025-10-02 21:44:34 +00:00
Fix a bug
This commit is contained in:
parent
c7096b17f1
commit
208433d337
6 changed files with 26 additions and 6 deletions
|
@ -3111,7 +3111,7 @@ impl fmt::Display for Params {
|
|||
f,
|
||||
"({}, {}, {})",
|
||||
fmt_vec(&self.non_defaults),
|
||||
fmt_option!(pre "...", &self.var_params),
|
||||
fmt_option!(pre "*", &self.var_params),
|
||||
fmt_vec(&self.defaults)
|
||||
)
|
||||
}
|
||||
|
@ -3132,8 +3132,9 @@ impl Locational for Params {
|
|||
) {
|
||||
(Some(l), _, Some(r)) => Location::concat(l, r),
|
||||
(Some(l), Some(r), None) => Location::concat(l, r.as_ref()),
|
||||
(Some(l), None, None) => Location::concat(l, self.non_defaults.last().unwrap()),
|
||||
(None, Some(l), Some(r)) => Location::concat(l.as_ref(), r),
|
||||
(Some(l), None, None) => Location::concat(l, self.non_defaults.last().unwrap()),
|
||||
(None, Some(var), None) => var.loc(),
|
||||
(None, None, Some(r)) => Location::concat(self.defaults.first().unwrap(), r),
|
||||
_ => Location::Unknown,
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue