Skip to content

Commit 150c7a1

Browse files
authored
Use _return_type from Base, not from Core.Compiler (#819)
1 parent 02e21ba commit 150c7a1

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "ChainRules"
22
uuid = "082447d4-558c-5d27-93f4-14fc19e9eca2"
3-
version = "1.72.2"
3+
version = "1.72.3"
44

55
[deps]
66
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"

src/rulesets/Base/broadcast.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ end
4848
# Path 2: This is roughly what `derivatives_given_output` is designed for, should be fast.
4949

5050
function may_bc_derivatives(::Type{T}, f::F, args::Vararg{Any,N}) where {T,F,N}
51-
= Core.Compiler._return_type(derivatives_given_output, Tuple{T, F, map(_eltype, args)...})
51+
= Core.Compiler.return_type(derivatives_given_output, Tuple{T, F, map(_eltype, args)...})
5252
return isconcretetype(TΔ)
5353
end
5454

@@ -98,7 +98,7 @@ function may_bc_forwards(cfg::C, f::F, arg) where {C,F}
9898
TA = _eltype(arg)
9999
TA <: Real || return false
100100
cfg isa RuleConfig{>:HasForwardsMode} && return true # allows frule_via_ad
101-
TF = Core.Compiler._return_type(frule, Tuple{C, Tuple{NoTangent, TA}, F, TA})
101+
TF = Core.Compiler.return_type(frule, Tuple{C, Tuple{NoTangent, TA}, F, TA})
102102
return isconcretetype(TF) && TF <: Tuple
103103
end
104104

src/rulesets/Base/mapreduce.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ Works by seeing if the result of `derivatives_given_output(nothing, f, x)` can b
139139
The method of `derivatives_given_output` usually comes from `@scalar_rule`.
140140
"""
141141
function _uses_input_only(f::F, ::Type{xT}) where {F,xT}
142-
gT = Core.Compiler._return_type(derivatives_given_output, Tuple{Nothing, F, xT})
142+
gT = Core.Compiler.return_type(derivatives_given_output, Tuple{Nothing, F, xT})
143143
# Here we must check `<: Number`, to avoid this, the one rule which can return the `nothing`:
144144
# ChainRules.derivatives_given_output("anything", exp, 1) == (("anything",),)
145145
return isconcretetype(gT) && gT <: Tuple{Tuple{Number}}

0 commit comments

Comments
 (0)