From e00a28cd6881e4a7632187c5b18792c366e2b2cf Mon Sep 17 00:00:00 2001 From: Paul Date: Sun, 21 Jan 2024 12:47:14 +0100 Subject: [PATCH] improve line info display for error message --- src/compiler/reverse.jl | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/compiler/reverse.jl b/src/compiler/reverse.jl index f47560541..5ed79ea81 100644 --- a/src/compiler/reverse.jl +++ b/src/compiler/reverse.jl @@ -328,9 +328,8 @@ function adjoint(pr::Primal) if has_leave && isempty(predecessors(b)) && b.id != 1 _, f_stmt = first(b) li = pr.ir.lines[f_stmt.line] - li = LineNumberNode(Int(li.line), li.file) pushfirst!(rb, stmt(xcall(Base, :error, - "Can't differentiate function execution in catch block at $(li)."))) + "Can't differentiate function execution in catch block at $(li.file):$(li.line)."))) end if b.id > 1 # Backprop through (predecessor) branch arguments