diff --git a/src/data/writing_datatypes.jl b/src/data/writing_datatypes.jl index f1fdc0b6..91c9f9f4 100644 --- a/src/data/writing_datatypes.jl +++ b/src/data/writing_datatypes.jl @@ -446,7 +446,7 @@ end function h5convert!(out::Pointers, ::DataTypeODR, f::JLDFile, T::DataType, wsession::JLDWriteSession) t = typename(T) - if T <: Function && Base.isgensym(nameof(T.instance)) + if T <: Function && isgensym(nameof(T.instance)) @warn LazyString("Attempting to store ", T, ".\n", "JLD2 only stores functions by name.\n", " This may not be useful for anonymous functions.") diff --git a/src/julia_compat.jl b/src/julia_compat.jl index f17e348e..a577bebb 100644 --- a/src/julia_compat.jl +++ b/src/julia_compat.jl @@ -28,4 +28,10 @@ end end else using Base: @nospecializeinfer +end + +@static if VERSION < v"1.7.0" + isgensym(s::Symbol) = '#' in string(s) +else + using Base: isgensym end \ No newline at end of file