mirror of
https://github.com/erg-lang/erg.git
synced 2025-08-04 02:39:20 +00:00
fix: compile-time eval bug
This commit is contained in:
parent
ca88e82c9f
commit
c9438f215a
5 changed files with 140 additions and 2 deletions
|
@ -603,7 +603,7 @@ impl Context {
|
|||
match acc {
|
||||
Accessor::Ident(ident) => {
|
||||
let obj = self.rec_get_const_obj(ident.inspect()).ok_or_else(|| {
|
||||
EvalError::no_var_error(
|
||||
EvalError::not_comptime_fn_error(
|
||||
self.cfg.input.clone(),
|
||||
line!() as usize,
|
||||
ident.loc(),
|
||||
|
@ -1170,6 +1170,20 @@ impl Context {
|
|||
line!(),
|
||||
))
|
||||
}),
|
||||
Pow => lhs.try_pow(rhs).ok_or_else(|| {
|
||||
EvalErrors::from(EvalError::unreachable(
|
||||
self.cfg.input.clone(),
|
||||
fn_name!(),
|
||||
line!(),
|
||||
))
|
||||
}),
|
||||
Mod => lhs.try_mod(rhs).ok_or_else(|| {
|
||||
EvalErrors::from(EvalError::unreachable(
|
||||
self.cfg.input.clone(),
|
||||
fn_name!(),
|
||||
line!(),
|
||||
))
|
||||
}),
|
||||
Gt => lhs.try_gt(rhs).ok_or_else(|| {
|
||||
EvalErrors::from(EvalError::unreachable(
|
||||
self.cfg.input.clone(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue