Add Dynamic::is_XXX API.
This commit is contained in:
@@ -374,7 +374,7 @@ impl Expr {
|
||||
fn ensure_bool_expr(self) -> ParseResult<Expr> {
|
||||
let type_name = match self {
|
||||
Expr::Unit(..) => "()",
|
||||
Expr::DynamicConstant(ref v, ..) if !v.is::<bool>() => v.type_name(),
|
||||
Expr::DynamicConstant(ref v, ..) if !v.is_bool() => v.type_name(),
|
||||
Expr::IntegerConstant(..) => "a number",
|
||||
#[cfg(not(feature = "no_float"))]
|
||||
Expr::FloatConstant(..) => "a floating-point number",
|
||||
@@ -1248,7 +1248,7 @@ impl Engine {
|
||||
continue;
|
||||
}
|
||||
|
||||
if value.is::<INT>() && !ranges.is_empty() {
|
||||
if value.is_int() && !ranges.is_empty() {
|
||||
return Err(PERR::WrongSwitchIntegerCase.into_err(expr.start_position()));
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user