Skip to content

Commit 2ae7a62

Browse files
committed
Enable idiomatic record.pt syntax
1 parent 6ba1c4a commit 2ae7a62

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/all_implementations.jl

+8-3
Original file line numberDiff line numberDiff line change
@@ -2093,11 +2093,16 @@ slot(
20932093
layout::Record{FIELDS,CONTENTS},
20942094
f::Symbol,
20952095
) where {FIELDS,CONTENTS<:Base.Tuple{Vararg{Content}}}
2096+
2097+
Base.getindex(
2098+
layout::AwkwardArray.Record,
2099+
f::Symbol,
2100+
) = getfield(layout, :array).contents[f][getfield(layout, :at)]
20962101
"""
20972102
Base.getindex(
2098-
layout::Record{FIELDS,CONTENTS},
2099-
f::Symbol,
2100-
) where {FIELDS,CONTENTS<:Base.Tuple{Vararg{Content}}} = layout.array.contents[f][layout.at]
2103+
layout::AwkwardArray.Record,
2104+
f::Symbol,
2105+
) = getfield(layout, :array).contents[f][getfield(layout, :at)]
21012106

21022107
"""
21032108
Base.:(==)(

0 commit comments

Comments
 (0)