Avoid shadowing indexer errors.

This commit is contained in:
Stephen Chung 2020-07-25 09:55:33 +08:00
parent 554ee07e01
commit 463d669ab5

View File

@ -1050,6 +1050,7 @@ impl Engine {
} }
} }
#[cfg(not(feature = "no_object"))]
#[cfg(not(feature = "no_index"))] #[cfg(not(feature = "no_index"))]
_ => { _ => {
let type_name = self.map_type_name(val.type_name()); let type_name = self.map_type_name(val.type_name());
@ -1058,11 +1059,11 @@ impl Engine {
state, lib, FN_IDX_GET, true, 0, args, is_ref, true, None, level, state, lib, FN_IDX_GET, true, 0, args, is_ref, true, None, level,
) )
.map(|(v, _)| v.into()) .map(|(v, _)| v.into())
.map_err(|_| { .map_err(|err| match *err {
Box::new(EvalAltResult::ErrorIndexingType( EvalAltResult::ErrorFunctionNotFound(_, _) => Box::new(
type_name.into(), EvalAltResult::ErrorIndexingType(type_name.into(), Position::none()),
Position::none(), ),
)) _ => err,
}) })
} }