Skip to content

Commit 4f8b1be

Browse files
committed
Fix Cthulhu integration on 1.6.
1 parent 89a730c commit 4f8b1be

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/reflection.jl

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,14 @@ function code_warntype(io::IO, @nospecialize(job::CompilerJob); interactive::Boo
7878
# call Cthulhu without introducing a dependency on Cthulhu
7979
mod = get(Base.loaded_modules, Cthulhu, nothing)
8080
mod===nothing && error("Interactive code reflection requires Cthulhu; please install and load this package first.")
81-
interp = get_interpreter(job)
82-
descend_code_warntype = getfield(mod, :descend_code_warntype)
83-
descend_code_warntype(sig; interp, kwargs...)
81+
if VERSION < v"1.7-"
82+
descend_code_typed = getfield(mod, :descend_code_typed)
83+
descend_code_typed(job.source; kwargs...)
84+
else
85+
interp = get_interpreter(job)
86+
descend_code_warntype = getfield(mod, :descend_code_warntype)
87+
descend_code_warntype(sig; interp, kwargs...)
88+
end
8489
elseif VERSION >= v"1.7-"
8590
interp = get_interpreter(job)
8691
code_warntype_by_type(io, sig; interp, kwargs...)

0 commit comments

Comments
 (0)