diff --git a/src/utils.jl b/src/utils.jl index 02052a1..428f75d 100644 --- a/src/utils.jl +++ b/src/utils.jl @@ -1,6 +1,6 @@ function isfuncexpr(ex) # Strip any macros that wrap the method definition - while isexpr(ex, :macrocall) + while isexpr(ex, :macrocall) && length(ex.args) == 3 ex = ex.args[3] end isa(ex, Expr) || return false diff --git a/test/runtests.jl b/test/runtests.jl index b0ae68d..d203172 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -128,3 +128,16 @@ l = @__LINE__ @test line == l - 3 @test def == "(d_34)(x::T, y::T) where {T<:Number} = x === y" end + +function g() + Base.@_inline_meta + print("hello") +end +@testset "inline macros" begin + def, line = CodeTracking.definition(String, @which g()) + @test def == """ + function g() + Base.@_inline_meta + print("hello") + end""" +end