From 190561d264b83cf4c884d36b9ef237c443372f37 Mon Sep 17 00:00:00 2001 From: Shunsuke Shibayama Date: Wed, 14 Dec 2022 11:49:01 +0900 Subject: [PATCH] Update ast.rs --- compiler/erg_parser/ast.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/compiler/erg_parser/ast.rs b/compiler/erg_parser/ast.rs index f797942b..e3e1f228 100644 --- a/compiler/erg_parser/ast.rs +++ b/compiler/erg_parser/ast.rs @@ -171,7 +171,7 @@ impl Locational for Args { (Some(l), Some(r)) => Location::concat(l, r), (Some(l), None) => Location::concat(l, self.pos_args.last().unwrap()), (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() { Location::concat(self.pos_args.first().unwrap(), last) } else { - unreachable!() + Location::Unknown } } } @@ -3143,7 +3143,7 @@ impl Locational for LambdaSignature { } else if let Some(return_t) = &self.return_t_spec { Location::concat(&self.params, return_t) } else if self.params.is_empty() && self.params.parens.is_none() { - unreachable!() + Location::Unknown } else { self.params.loc() }