You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
replace field_offset and fieldoffset with fieldoffset
`field_offset` was untested, undocumented, unexported, and incorrect (off-by-one error in implementation)
`fieldoffset` just isn't particularly optimal, since it has to allocate a new array each time
also make minor cleanup and test-coverage enhancements to related reflection methods
Copy file name to clipboardexpand all lines: doc/stdlib/base.rst
+9-3
Original file line number
Diff line number
Diff line change
@@ -520,15 +520,15 @@ Types
520
520
521
521
Assign ``x`` to a named field in ``value`` of composite type. The syntax ``a.b = c`` calls ``setfield!(a, :b, c)``\ , and the syntax ``a.(b) = c`` calls ``setfield!(a, b, c)``\ .
522
522
523
-
.. function:: fieldoffsets(type)
523
+
.. function:: fieldoffset(type, i)
524
524
525
525
.. Docstring generated from Julia source
526
526
527
-
The byte offset of each field of a type relative to the data start. For example, we could use it in the following manner to summarize information about a struct type:
527
+
The byte offset of field ``i`` of a type relative to the data start. For example, we could use it in the following manner to summarize information about a struct type:
0 commit comments