# Change in behaviour of ForwardDiff in Julia 1.9

**URL:** <https://discourse.julialang.org/t/change-in-behaviour-of-forwarddiff-in-julia-1-9/98616>\
**Category:** General Usage\
**Created:** [May 10, 2023, 2:04pm UTC](https://discourse.julialang.org/t/change-in-behaviour-of-forwarddiff-in-julia-1-9/98616 "2023-05-10T14:04:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![user664303](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/user664303/32/37843_2.png) [@user664303](https://discourse.julialang.org/u/user664303)\
**Post date:** [May 10, 2023, 2:04pm UTC](https://discourse.julialang.org/t/change-in-behaviour-of-forwarddiff-in-julia-1-9/98616/1 "2023-05-10T14:04:53Z")

</div>

Does anyone know why there would be a change in the output type of the following code between Julia versions 1.8 and 1.9?:

```julia
using ForwardDiff, StaticArrays
ForwardDiff.jacobian(z -> SVector{2}(z[1], z[2]), zeros(SVector{2, Float64}))

```

Outputs:  
Julia 1.8.2, ForwardDiff 0.10.35:

```julia
2×2 SMatrix{2, 2, Float64, 4} with indices SOneTo(2)×SOneTo(2):
 1.0 0.0
 0.0 1.0

```

Julia 1.9.0, ForwardDiff 0.10.35:

```julia
2×2 Matrix{Float64}:
 1.0 0.0
 0.0 1.0

```

---

<div class="post-metadata">

**Author:** ![fgerick](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fgerick/32/13228_2.png) [@fgerick](https://discourse.julialang.org/u/fgerick)\
**Post date:** [May 10, 2023, 2:27pm UTC](https://discourse.julialang.org/t/change-in-behaviour-of-forwarddiff-in-julia-1-9/98616/2 "2023-05-10T14:27:17Z")

</div>

I cannot reproduce.

```julia
julia> versioninfo()
Julia Version 1.9.0
Commit 8e630552924 (2023-05-07 11:25 UTC)
Platform Info:
  OS: macOS (x86_64-apple-darwin22.4.0)
  CPU: 16 × Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-14.0.6 (ORCJIT, skylake)
  Threads: 16 on 16 virtual cores
Environment:
  LD_LIBRARY_PATH = /Users/xxx/usr/lib/:/Users/xxx/usr/lib/:
  JULIA_NUM_THREADS = 16

(jl_2UjAWm) pkg> st
Status `/private/var/folders/kj/g4l55jh967zgr_gdj12tbjdm0000gn/T/jl_2UjAWm/Project.toml`
  [f6369f11] ForwardDiff v0.10.35
  [90137ffa] StaticArrays v1.5.24

julia> using ForwardDiff, StaticArrays

julia> ForwardDiff.jacobian(z -> SVector{2}(z[1], z[2]), zeros(SVector{2, Float64}))
2×2 SMatrix{2, 2, Float64, 4} with indices SOneTo(2)×SOneTo(2):
 1.0 0.0
 0.0 1.0

```

---

<div class="post-metadata">

**Author:** ![user664303](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/user664303/32/37843_2.png) [@user664303](https://discourse.julialang.org/u/user664303)\
**Post date:** [May 10, 2023, 3:05pm UTC](https://discourse.julialang.org/t/change-in-behaviour-of-forwarddiff-in-julia-1-9/98616/3 "2023-05-10T15:05:43Z")

</div>

Ah, many thanks for checking, @fgerick . Updating StaticArrays from 1.5.21 to 1.5.24 also fixed it for me.

It might also be related to [this issue](https://github.com/JuliaDiff/ForwardDiff.jl/issues/639).
