From 47c5460ac48ccd6817001798ab69b88ace149761 Mon Sep 17 00:00:00 2001 From: Avik Pal Date: Thu, 12 Sep 2024 15:15:05 -0400 Subject: [PATCH] fix: assert for non-wrapped arrays only --- Project.toml | 2 +- src/utils.jl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Project.toml b/Project.toml index 7197664..242119b 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 fa67892..6d845d9 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