Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# (or change the test)
function checkname(fdef::Expr, name)
fproto = fdef.args[1]
fdef.head === :where && return checkname(fproto, name)
(fdef.head === :where || fdef.head == :(::)) && return checkname(fproto, name)
fdef.head === :call || return false
if fproto isa Expr
# A metaprogramming-generated function
Expand Down
6 changes: 6 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,12 @@ isdefined(Main, :Revise) ? Main.Revise.includet("script.jl") : include("script.j
@test occursin("100x", src)
@test line == 22

# Issue #81
m = which(hasrettype, (Int,))
src, line = definition(String, m)
@test occursin("Float32", src)
@test line == 43

info = CodeTracking.PkgFiles(Base.PkgId(CodeTracking))
@test Base.PkgId(info) === info.id
@test CodeTracking.basedir(info) == dirname(@__DIR__)
Expand Down
5 changes: 5 additions & 0 deletions test/script.jl
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,8 @@ function Foo.Bar.fit(m)
end

Foo.Bar.fit(a, b) = a + b

# Issue #81
function hasrettype(x::Real)::Float32
return x*x + x
end