-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Closed
Description
sz1 = (3,2)
sz2 = (5,5)
sz3 = (3,2)
sz4 = (2,)
A = randn(sz1..., sz2..., sz3..., sz4...);
i1 = rand(CartesianIndices(sz1))
i2 = rand(CartesianIndices(sz2))
i3 = rand(CartesianIndices(sz3))
i4 = rand(CartesianIndices(sz4))
using Test
@inferred A[i1,i2,i3,i4] # failsIn this case it seems type inference is just giving up.
In fact, Base.to_indices(A, (j, k, b)) is just calling Base.to_indices(A, (), (j, k, b)).
But Base.to_indices(A, (j, k, b)) does not infer, while Base.to_indices(A, (), (j, k, b)) infers.
Metadata
Metadata
Assignees
Labels
No labels