Skip to content

Commit 7343b96

Browse files
authored
Fix issue 115 (#117)
1 parent e793fbc commit 7343b96

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

src/utils.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,10 @@ function is_func_expr(@nospecialize(ex), meth::Method)
9191
fname = fname.args[end]
9292
modified = true
9393
end
94+
if isexpr(fname, :where)
95+
fname = fname.args[1]
96+
modified = true
97+
end
9498
end
9599
if !(isa(fname, Symbol) && is_gensym(fname)) && !isexpr(fname, :$)
96100
if fname === :Type && isexpr(ex.args[1], :where) && isexpr(callex.args[1], :(::)) && isexpr(callex.args[1].args[end], :curly)

test/runtests.jl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,12 @@ isdefined(Main, :Revise) ? Main.Revise.includet("script.jl") : include("script.j
251251
CodeTracking.invoked_setindex!(d, sin, "sin")
252252
@test CodeTracking.invoked_get!(Vector{Function}, d, :cos) isa Vector{Function}
253253

254+
# Issue 115, Cthulhu issue 404
255+
m = @which (Vector)(Int[])
256+
src, line = definition(String, m)
257+
@test occursin("(Array{T,N} where T)(x::AbstractArray{S,N}) where {S,N}", src)
258+
@test line == m.line
259+
254260
# Issue 115, Cthulhu issue 474
255261
m = @which NamedTuple{(),Tuple{}}(())
256262
src, line = definition(String, m)

0 commit comments

Comments
 (0)