We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 35b83a4 commit 4e361cbCopy full SHA for 4e361cb
test/differentials.jl
@@ -66,6 +66,21 @@
66
@test (@thunk(3))() == 3
67
@test (@thunk(@thunk(3)))() isa Thunk
68
end
69
+
70
+ @testset "erroring thunks should include the source in the backtrack" begin
71
+ expected_line = (@__LINE__) + 2 # for testing it is at right palce
72
+ try
73
+ x = @thunk(error())
74
+ extern(x)
75
+ catch err
76
+ err isa ErrorException || rethrow()
77
+ st = stacktrace(catch_backtrace())
78
+ # Should be 2nd last line, as last line will be the `error` function
79
+ stackframe = st[2]
80
+ @test stackframe.line == expected_line
81
+ @test stackframe.file == Symbol(@__FILE__)
82
+ end
83
84
85
86
@testset "No ambiguities in $f" for f in (+, *)
0 commit comments