Skip to content

Commit 7e798c2

Browse files
authored
Make import Cassette work on Julia 1.12 (although the package probably won't work on 1.12) (#210)
1 parent 44ae68e commit 7e798c2

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/overdub.jl

+9-4
Original file line numberDiff line numberDiff line change
@@ -595,10 +595,15 @@ end
595595

596596
@eval _overdub_fallback($OVERDUB_CONTEXT_NAME, $OVERDUB_ARGUMENTS_NAME...) = fallback($OVERDUB_CONTEXT_NAME, $OVERDUB_ARGUMENTS_NAME...)
597597

598-
const OVERDUB_FALLBACK = begin
599-
code_info = reflect((typeof(_overdub_fallback), Any, Vararg{Any})).code_info
600-
code_info.inlineable = true
601-
code_info
598+
@static if Base.VERSION >= v"1.12-"
599+
# Make Cassette.jl loadable (but not usable) on Julia 1.12.
600+
@warn "Cassette.jl may not work on this version of Julia" Base.VERSION
601+
else
602+
const OVERDUB_FALLBACK = begin
603+
code_info = reflect((typeof(_overdub_fallback), Any, Vararg{Any})).code_info
604+
code_info.inlineable = true
605+
code_info
606+
end
602607
end
603608

604609
# `args` is `(typeof(original_function), map(typeof, original_args_tuple)...)`

0 commit comments

Comments
 (0)