Skip to content

Commit c607c0d

Browse files
raminammourc42f
authored andcommitted
Tweak missing size error (#654)
Right now calls `SArray(rand(3,3,4))` produces this error. `SMatrix{3,3}` works but `SArray{3,3}` doesn't; this change makes the requirement of SArray{Tuple{3,3}} explicit.
1 parent 712c12f commit c607c0d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/traits.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,9 @@ function missing_size_error(::Type{SA}) where SA
7878
example, you might try
7979
8080
m = zeros(3,3)
81-
SMatrix(m) # this error
82-
SMatrix{3,3}(m) # correct - size is inferrable
81+
SMatrix(m) # this error
82+
SMatrix{3,3}(m) # correct - size is inferrable
83+
SArray{Tuple{3,3}}(m) # correct, note Tuple{3,3}
8384
""")
8485
end
8586

0 commit comments

Comments
 (0)