Closed
Description
openedon Sep 12, 2016
Unitful breaks the type-stability of Rational
:
julia> using Unitful
INFO: Recompiling stale cache file /home/tim/.julia/lib/v0.5/Unitful.ji for module Unitful.
julia> @code_warntype Rational(5463, 20)
Variables:
#self#::Type{Rational}
n::Int64
d::Int64
Body:
begin
return $(Expr(:invoke, LambdaInfo for Rational{Int64}(::Int64, ::Int64), Rational{Int64}, :(n), :(d)))
end::Any
If you comment out this line and this function, then it's back to normal. Indeed, just the signature of the latter function (i.e., defining a blank body) is sufficient to break the type-stability of Rational
.
What I find curious is that the latter function does not obviously have anything to do with Rational
. Seems to suggest some kind of corruption.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment