@@ -29,6 +29,9 @@ const BitIntegerSmall = Union{BitIntegerSmall_types...}
2929const BitSigned64T = Union{Type{Int8}, Type{Int16}, Type{Int32}, Type{Int64}}
3030const BitUnsigned64T = Union{Type{UInt8}, Type{UInt16}, Type{UInt32}, Type{UInt64}}
3131
32+ throw_inexacterror (f:: Symbol , :: Type{T} , val) where T =
33+ (@_noinline_meta ; throw (InexactError (f, T, val)))
34+
3235# # integer comparisons ##
3336
3437(< )(x:: T , y:: T ) where {T<: BitSigned } = slt_int (x, y)
@@ -401,7 +404,7 @@ function is_top_bit_set(x::BitInteger)
401404end
402405function check_top_bit (x:: BitInteger )
403406 @_inline_meta
404- is_top_bit_set (x) && throw ( InexactError ( :check_top_bit , Integer , x) )
407+ is_top_bit_set (x) && throw_inexacterror ( :check_top_bit , typeof (x) , x)
405408 x
406409end
407410
@@ -411,15 +414,15 @@ function checked_trunc_sint{To,From}(::Type{To}, x::From)
411414 @_inline_meta
412415 y = trunc_int (To, x)
413416 back = sext_int (From, y)
414- x == back || throw ( InexactError ( :trunc , To, x) )
417+ x == back || throw_inexacterror ( :trunc , To, x)
415418 y
416419end
417420
418421function checked_trunc_uint {To,From} (:: Type{To} , x:: From )
419422 @_inline_meta
420423 y = trunc_int (To, x)
421424 back = zext_int (From, y)
422- x == back || throw ( InexactError ( :trunc , To, x) )
425+ x == back || throw_inexacterror ( :trunc , To, x)
423426 y
424427end
425428
0 commit comments