Skip to content

Commit 11a9949

Browse files
authored
Use ComposedFunction public API (#2451)
1 parent 4d4e490 commit 11a9949

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

Project.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ test = ["DataStructures", "DataValues", "Dates", "Logging", "Random", "Test"]
3636
[compat]
3737
julia = "1"
3838
CategoricalArrays = "0.8"
39-
Compat = "2.2, 3"
39+
Compat = "3.17"
4040
DataAPI = "1.2"
4141
InvertedIndices = "1"
4242
IteratorInterfaceExtensions = "0.1.1, 1"

src/other/utils.jl

+2-7
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,7 @@ end
7979
if isdefined(Base, :ComposedFunction) # Julia >= 1.6.0-DEV.85
8080
using Base: ComposedFunction
8181
else
82-
const ComposedFunction = let h = identity convert
83-
@assert h.f === identity
84-
@assert h.g === convert
85-
getfield(parentmodule(typeof(h)), nameof(typeof(h)))
86-
end
87-
@assert identity convert isa ComposedFunction
82+
using Compat: ComposedFunction
8883
end
8984

90-
funname(c::ComposedFunction) = Symbol(funname(c.f), :_, funname(c.g))
85+
funname(c::ComposedFunction) = Symbol(funname(c.outer), :_, funname(c.inner))

0 commit comments

Comments
 (0)