Skip to content

Commit 8d88f0c

Browse files
odilfhyrodium
andauthored
improve error message of setindex! (#1073)
* improve error message of `setindex!` * Update the error message on src/indexing.jl Co-authored-by: Yuto Horikawa <[email protected]>
1 parent 0feac14 commit 8d88f0c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/indexing.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Default error messages to help users with new types and to avoid subsequent stack overflows
22
getindex(a::StaticArray, i::Int) = error("getindex(::$(typeof(a)), ::Int) is not defined.")
3-
setindex!(a::StaticArray, value, i::Int) = error("setindex!(::$(typeof(a)), value, ::Int) is not defined.")
3+
setindex!(a::StaticArray, value, i::Int) = error("setindex!(::$(typeof(a)), value, ::Int) is not defined.\n Hint: Use `MArray` or `SizedArray` to create a mutable static array")
44

55
#######################################
66
## Multidimensional scalar indexing ##

0 commit comments

Comments
 (0)