@@ -268,12 +268,6 @@ function Base.setindex!(a::TracedRArray{T,N}, v, indices) where {T,N}
268268 return a
269269end
270270
271- function Base. setindex! (a:: TracedRArray{T,N} , v, :: Colon ) where {T,N}
272- v = TracedUtils. broadcast_to_size (v, size (a))
273- set_mlir_data! (a, get_mlir_data (v))
274- return a
275- end
276-
277271function Base. setindex! (a:: TracedRArray{T,N} , v, indices:: CartesianIndex{N} ) where {T,N}
278272 GPUArraysCore. assertscalar (" setindex!(::TracedRArray, v, ::CartesianIndex{N})" )
279273 indices =
@@ -293,6 +287,16 @@ function Base.setindex!(a::TracedRArray{T,N}, v, indices::CartesianIndex{N}) whe
293287end
294288
295289function Base. setindex! (a:: TracedRArray{T,N} , v, indices:: Vararg{Any,N} ) where {T,N}
290+ if (N == 1 ) && (indices isa Colon)
291+ # Remove ambiguity from the previous
292+ # ```julia
293+ # Base.setindex!(a::TracedRArray{T,N}, v, ::Colon) where {T,N}
294+ # ```
295+ # signature, which would be confused with this one for N=1.
296+ v = TracedUtils. broadcast_to_size (v, size (a))
297+ set_mlir_data! (a, get_mlir_data (v))
298+ return a
299+ end
296300 maybe_assert_scalar_setindexing (a, indices... )
297301
298302 indices = TracedUtils. normalize_indices (a, indices... )
0 commit comments