Skip to content

Commit 21540b4

Browse files
committed
Workaround for comprehensions built from svectors
This doesn't address the root cause, but works around the issue reported in #76.
1 parent 6df38ac commit 21540b4

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/SArray.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ macro SArray(ex)
145145
ex = ex.args[1]
146146
n_rng = length(ex.args) - 1
147147
rng_args = [ex.args[i+1].args[1] for i = 1:n_rng]
148-
rngs = [eval(current_module(), ex.args[i+1].args[2]) for i = 1:n_rng]
148+
rngs = Any[eval(current_module(), ex.args[i+1].args[2]) for i = 1:n_rng]
149149
rng_lengths = map(length, rngs)
150150

151151
f = gensym()

test/SArray.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@
5656

5757
m = [1 2; 3 4]
5858
@test SArray{(2,2)}(m) === @SArray [1 2; 3 4]
59+
60+
# Non-square comprehensions built from SVectors - see #76
61+
@test @SArray([1 for x = SVector(1,2), y = SVector(1,2,3)]) == ones(2,3)
5962
end
6063

6164
@testset "Methods" begin

0 commit comments

Comments
 (0)