Disallow implicit comparisons between different numeric types.

This commit is contained in:
Stephen Chung
2021-02-24 15:45:29 +08:00
parent 0d933d865a
commit 4ac05aee8b
11 changed files with 125 additions and 114 deletions

View File

@@ -21,7 +21,7 @@ def_package!(crate:BasicStringPackage:"Basic string utilities, including printin
#[cfg(any(not(feature = "no_index"), not(feature = "no_object")))]
#[inline(always)]
fn print_with_func(fn_name: &str, ctx: &NativeCallContext, value: &mut Dynamic) -> ImmutableString {
match ctx.call_fn_dynamic_raw(fn_name, true, false, &mut [value], None) {
match ctx.call_fn_dynamic_raw(fn_name, true, false, &mut [value]) {
Ok(result) if result.is::<ImmutableString>() => result.take_immutable_string().unwrap(),
Ok(result) => ctx.engine().map_type_name(result.type_name()).into(),
Err(_) => ctx.engine().map_type_name(value.type_name()).into(),