-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Closed
Labels
priorityThis should be addressed urgentlyThis should be addressed urgentlywon't changeIndicates that work won't continue on an issue or pull requestIndicates that work won't continue on an issue or pull request
Milestone
Description
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.
Metadata
Metadata
Assignees
Labels
priorityThis should be addressed urgentlyThis should be addressed urgentlywon't changeIndicates that work won't continue on an issue or pull requestIndicates that work won't continue on an issue or pull request