This repository was archived by the owner on May 12, 2026. It is now read-only.
Description Hi! With the following code:
module MyTest2
using ArrayInterface
export A
struct A{T}
a:: T
end
ArrayInterface. ismutable (:: Type{<:A} ) = true
using RecursiveArrayTools
using OrdinaryDiffEq
using DiffEqBase
export Workspace
mutable struct Workspace{T} <: DEDataVector{T}
x:: Vector{T}
a:: A{T}
end
export test
function test ()
w1 = Workspace (zeros (3 ), A (0.0 ))
w2 = Workspace (zeros (3 ), A (0.0 ))
return RecursiveArrayTools. recursivecopy! (w1,w2)
end
end
I am getting the following error when calling the function test():
julia> test ()
ERROR: StackOverflowError:
Stacktrace:
[1 ] ismutable (:: Type{T} where T) at / Users/ ronan. arraes/ . julia/ packages/ ArrayInterface/ YFV07/ src/ ArrayInterface. jl: 19 (repeats 79978 times)
I think it is related to the @generated function recursivecopy!. Because, this code works outside a module:
using ArrayInterface
struct A{T}
a:: T
end
ArrayInterface. ismutable (:: Type{<:A} ) = false
using RecursiveArrayTools
using OrdinaryDiffEq
using DiffEqBase
mutable struct Workspace{T} <: DEDataVector{T}
x:: Vector{T}
a:: A{T}
end
function test ()
w1 = Workspace (zeros (3 ), A (0.0 ))
w2 = Workspace (zeros (3 ), A (0.0 ))
return RecursiveArrayTools. recursivecopy! (w1,w2)
end
julia> test ()
3 - element Workspace{Float64}:
0.0
0.0
0.0 Reactions are currently unavailable
Hi! With the following code:
I am getting the following error when calling the function
test():I think it is related to the
@generatedfunctionrecursivecopy!. Because, this code works outside a module: