Skip to content

Commit 3eabefd

Browse files
jakobnissenJakob Nybo Andersen
authored andcommitted
Fixup: Make parent work on Julia 1.11
1 parent ddf6272 commit 3eabefd

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

src/basic.jl

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,9 @@ function Base.setindex!(v::MutableMemoryView{T}, x, i::Int) where {T}
66
return v
77
end
88

9-
# In v1.12, this `parent` method was added. Before 1.12, we load this undocumented
10-
# field. This is safe-ish because it's very unlikely changes to the layout of
11-
# `MemoryRef` will be backported
12-
if VERSION < v"1.12"
9+
# The parent method for memoryref was added in 1.12. In versions before that,
10+
# it can be accessed by reaching into internals.
11+
@static if VERSION < v"1.12"
1312
Base.parent(v::MemoryView) = v.ref.mem
1413
else
1514
Base.parent(v::MemoryView) = parent(v.ref)

0 commit comments

Comments
 (0)