We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0bbc0e3 commit 4dbc2bdCopy full SHA for 4dbc2bd
src/convert.jl
@@ -13,9 +13,13 @@
13
unroll_tuple(a, Length(a))
14
end
15
16
+@noinline function dimension_mismatch_fail(SA::Type, a::AbstractArray)
17
+ error("Dimension mismatch. Expected input array of length $(length(SA)), got length $(length(a))")
18
+end
19
+
20
@inline function convert(::Type{SA}, a::AbstractArray) where {SA <: StaticArray}
21
@boundscheck if length(a) != length(SA)
- error("Dimension mismatch. Expected input array of length $(length(SA)), got length $(length(a))")
22
+ dimension_mismatch_fail(SA, a)
23
24
25
return SA(unroll_tuple(a, Length(SA)))
0 commit comments