Skip to content

Commit 088b101

Browse files
committed
Multiline function definitions
1 parent 5f6e608 commit 088b101

File tree

1 file changed

+14
-9
lines changed

1 file changed

+14
-9
lines changed

src/indexing.jl

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -205,21 +205,26 @@ end
205205

206206
# AbstractArrayInterface fallback definitions
207207
# -------------------------------------------
208-
@interface ::AbstractArrayInterface isstored(A::AbstractArray, i::Int, I::Int...) = (
209-
@inline; @boundscheck checkbounds(A, i, I...); true
210-
)
208+
@interface ::AbstractArrayInterface function isstored(A::AbstractArray, i::Int, I::Int...)
209+
@inline
210+
@boundscheck checkbounds(A, i, I...)
211+
return true
212+
end
211213

212214
@interface ::AbstractArrayInterface function getunstoredindex(A::AbstractArray, I::Int...)
213215
@inline
214216
@boundscheck checkbounds(A, I...)
215217
return zero(eltype(A))
216218
end
217-
@interface ::AbstractArrayInterface getstoredindex(A::AbstractArray, I::Int...) = (
218-
@inline; getindex(A, I...)
219-
)
220-
@interface ::AbstractArrayInterface setstoredindex!(A::AbstractArray, v, I::Int...) = (
221-
@inline; setindex!(A, v, I...)
222-
)
219+
@interface ::AbstractArrayInterface function getstoredindex(A::AbstractArray, I::Int...)
220+
@inline
221+
return getindex(A, I...)
222+
end
223+
224+
@interface ::AbstractArrayInterface function setstoredindex!(A::AbstractArray, v, I::Int...)
225+
@inline
226+
return setindex!(A, v, I...)
227+
end
223228
@interface ::AbstractArrayInterface setunstoredindex!(A::AbstractArray, v, I::Int...) =
224229
error("setunstoredindex! for $(typeof(A)) is not supported")
225230

0 commit comments

Comments
 (0)