-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Closed
Labels
compiler:inferenceType inferenceType inference
Description
Unfortunately this is currently blocking me ;-) but at least I could simplify it so that other can find a workaround or actually fix it.
in current julia 1.4 I get the following
julia> apply(f, args...; kwargs...) = f(args...; kwargs...)
apply (generic function with 1 method)
julia> Base.promote_op(apply, typeof(apply), typeof(sin), Int)
Any
julia> apply2(f, args...; kwargs...) = f(args...; kwargs...)
apply2 (generic function with 1 method)
julia> Base.promote_op(apply, typeof(apply2), typeof(sin), Int)
Float64
julia> Base.promote_op(apply2, typeof(apply2), typeof(sin), Int)
Float64
julia> Base.promote_op(apply, typeof(apply), typeof(sin), Int)
Anyhere again for quick copy and paste to try it yourself
apply(f, args...; kwargs...) = f(args...; kwargs...)
Base.promote_op(apply, typeof(apply), typeof(sin), Int)
apply2(f, args...; kwargs...) = f(args...; kwargs...)
Base.promote_op(apply, typeof(apply2), typeof(sin), Int)
Base.promote_op(apply2, typeof(apply2), typeof(sin), Int)
Base.promote_op(apply, typeof(apply), typeof(sin), Int)and here with switched names
apply2(f, args...; kwargs...) = f(args...; kwargs...)
Base.promote_op(apply2, typeof(apply2), typeof(sin), Int)
apply(f, args...; kwargs...) = f(args...; kwargs...)
Base.promote_op(apply2, typeof(apply), typeof(sin), Int)
Base.promote_op(apply, typeof(apply), typeof(sin), Int)
Base.promote_op(apply2, typeof(apply2), typeof(sin), Int)
As you yourself can check, the unexpected outputs do not depend on the specific names, but seems to have todo with being the "first" or the "second" apply. Quite unbelievable.
Metadata
Metadata
Assignees
Labels
compiler:inferenceType inferenceType inference