using Reactant
using LinearAlgebra
using Oceananigans
using Oceananigans.Architectures: ReactantState
grid = RectilinearGrid(ReactantState(); size = (4, 4, 4), extent = (1, 1, 1))
c = CenterField(grid)
@compile raise = true LinearAlgebra.norm(c)
ERROR: LoadError: StackOverflowError:
Stacktrace:
[1] _has_debugcache()
@ Reactant.Compiler ~/.julia/packages/Reactant/gKeGW/src/compiler/Compiler.jl:1577
[2] debugcache(; throw_error::Bool)
@ Reactant.Compiler ~/.julia/packages/Reactant/gKeGW/src/compiler/Compiler.jl:1582
[3] debugcache
@ ~/.julia/packages/Reactant/gKeGW/src/compiler/Compiler.jl:1581 [inlined]
[4] push_debug_stack!(fname::String, file::String, line::Int64)
@ Reactant ~/.julia/packages/Reactant/gKeGW/src/utils.jl:682
[5] call_with_reactant(::Reactant.EnsureReturnType{Any}, ::typeof(fill!), ::ConcreteIFRTArray{Float64, 1, Nothing}, ::Float64)
@ Reactant ~/.julia/packages/Reactant/gKeGW/src/utils.jl:1195
[6] fill!
@ ~/.julia/packages/Reactant/gKeGW/src/ConcreteRArray.jl:811
--- the above 2 lines are repeated 19992 more times ---
[39991] call_with_reactant(::Reactant.EnsureReturnType{Any}, ::typeof(fill!), ::ConcreteIFRTArray{Float64, 1, Nothing}, ::Float64)
@ Reactant ~/.julia/packages/Reactant/gKeGW/src/utils.jl:1195