Skip to content

Commit e5ae4ad

Browse files
committed
Simplify the inference hacks
1 parent 2fe8831 commit e5ae4ad

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

src/dual_context.jl

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -209,10 +209,5 @@ end
209209

210210

211211
##### Inference Hacks
212-
# this makes `log` work by making throw_complex_domainerror inferable, but not really sure why
213-
@inline isinteresting(ctx::TaggedCtx, f::typeof(Core.throw), xs) = true
214-
# add `DualContext` here to avoid ambiguity
215-
@noinline alternative(ctx::Union{DualContext,TaggedCtx}, f::typeof(Core.throw), arg) = throw(arg)
216-
217-
@inline isinteresting(ctx::TaggedCtx, f::typeof(Base.print_to_string), args...) = true
218-
@noinline alternative(ctx::Union{DualContext,TaggedCtx}, f::typeof(Base.print_to_string), args...) = f(args...)
212+
@inline isinteresting(ctx::TaggedCtx, f::typeof(Base.print_to_string), args...) = false
213+
@inline Cassette.overdub(ctx::TaggedCtx, f::Core.Builtin, args...) = f(args...)

0 commit comments

Comments
 (0)