diff --git a/Project.toml b/Project.toml index 7197664d..242119bb 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "Boltz" uuid = "4544d5e4-abc5-4dea-817f-29e4c205d9c8" authors = ["Avik Pal and contributors"] -version = "0.4.1" +version = "0.4.2" [deps] ADTypes = "47edcb42-4c32-4615-8424-f2b9edc5f35b" diff --git a/src/utils.jl b/src/utils.jl index fa678920..6d845d9f 100644 --- a/src/utils.jl +++ b/src/utils.jl @@ -48,7 +48,7 @@ In certain cases, to ensure type-stability we want to add type-asserts. But this for exotic types like `ForwardDiff.Dual`. We use this function to check if we should add a type-assert for `x`. """ -should_type_assert(::AbstractArray{T}) where {T} = isbitstype(T) +should_type_assert(x::AbstractArray{T}) where {T} = isbitstype(T) && parent(x) === x should_type_assert(::AbstractArray{<:ForwardDiff.Dual}) = false should_type_assert(::ForwardDiff.Dual) = false should_type_assert(x) = true