You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With the optional generator syntax from #23168, there is currently no way of discovering errors that occur while executing the optional generator. In the case of a @generated function (ie. generated_only), the error will at least be noticed at run-time, but with optional generators we'll just ignore any error:
julia>functionfoo()
if@generatederror("I am invisible")
else42endend
foo (generic function with 1 method)
julia>foo()
42
whereas
julia>@generatedfunctionbar()
error("I am not invisible")
end
bar (generic function with 1 method)
julia>bar()
ERROR: I am not invisible
Stacktrace:
[1] error at ./error.jl:33 [inlined]
[2] #s2#3(::Any) at ./REPL[5]:2
[3] (::Core.GeneratedFunctionStub)(::Any, ::Vararg{Any,N}where N) at ./boot.jl:466
[4] top-level scope
I've long had a local change that prints the error along with a backtrace, since with CUDAnative we don't even get to see the error of a @generated function (because of allocs, calls to the runtime, etc). Now that there's a similar situation with regular code, I wonder if we need to do something more user friendly.
The text was updated successfully, but these errors were encountered:
With the optional generator syntax from #23168, there is currently no way of discovering errors that occur while executing the optional generator. In the case of a
@generated function
(ie.generated_only
), the error will at least be noticed at run-time, but with optional generators we'll just ignore any error:julia/base/compiler/utilities.jl
Lines 89 to 96 in bca94e4
Just to be clear:
whereas
I've long had a local change that prints the error along with a backtrace, since with CUDAnative we don't even get to see the error of a
@generated function
(because of allocs, calls to the runtime, etc). Now that there's a similar situation with regular code, I wonder if we need to do something more user friendly.The text was updated successfully, but these errors were encountered: