Update ast.rs

This commit is contained in:
Shunsuke Shibayama 2022-12-14 11:49:01 +09:00
parent 481761e50b
commit 190561d264

View file

@ -171,7 +171,7 @@ impl Locational for Args {
(Some(l), Some(r)) => Location::concat(l, r), (Some(l), Some(r)) => Location::concat(l, r),
(Some(l), None) => Location::concat(l, self.pos_args.last().unwrap()), (Some(l), None) => Location::concat(l, self.pos_args.last().unwrap()),
(None, Some(r)) => Location::concat(self.kw_args.first().unwrap(), r), (None, Some(r)) => Location::concat(self.kw_args.first().unwrap(), r),
_ => unreachable!(), _ => Location::Unknown,
} }
} }
} }
@ -1622,7 +1622,7 @@ impl Locational for ConstArgs {
} else if let Some(last) = self.pos_args.last() { } else if let Some(last) = self.pos_args.last() {
Location::concat(self.pos_args.first().unwrap(), last) Location::concat(self.pos_args.first().unwrap(), last)
} else { } else {
unreachable!() Location::Unknown
} }
} }
} }
@ -3143,7 +3143,7 @@ impl Locational for LambdaSignature {
} else if let Some(return_t) = &self.return_t_spec { } else if let Some(return_t) = &self.return_t_spec {
Location::concat(&self.params, return_t) Location::concat(&self.params, return_t)
} else if self.params.is_empty() && self.params.parens.is_none() { } else if self.params.is_empty() && self.params.parens.is_none() {
unreachable!() Location::Unknown
} else { } else {
self.params.loc() self.params.loc()
} }