Skip to content

Commit 1f2fcb4

Browse files
committed
Work around invokelatest issue
1 parent 2d423bf commit 1f2fcb4

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/transform/common.jl

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,16 @@ function rewrite_debuginfo!(ir::IRCode)
7272
for (i, stmt) in enumerate(ir.stmts)
7373
type = stmt[:type]
7474
annotation = type === nothing ? "" : " (inferred type: $type)"
75-
filename = Symbol("%$i = $(stmt[:inst])", annotation)
76-
lineno = LineNumberNode(1, filename)
75+
# Work around showing functions requiring `invokelatest` queries
76+
# that are problematic to execute from generated functions.
77+
local filename
78+
try
79+
filename = Symbol("%$i = $(stmt[:inst])", annotation)
80+
catch e
81+
isa(e, UndefVarError) && continue
82+
rethrow()
83+
end
84+
lineno = LineNumberNode(1, filename::Symbol)
7785
stmt[:line] = insert_debuginfo!(ir.debuginfo, i, lineno, stmt[:line])
7886
end
7987
end

0 commit comments

Comments
 (0)