swh:1:snp:a72e953ecd624a7df6e6196bbdd05851996c5e40
Revision cd4f44da76e78ad0472fddaa9f59e60e755d24ca authored by Jishnu Bhattacharya on 14 January 2024, 02:23:21 UTC, committed by GitHub on 14 January 2024, 02:23:21 UTC
After this,
```julia
julia> S = StructArray{Complex{Int}}(([1,2], [3,4]))
2-element StructArray(::Vector{Int64}, ::Vector{Int64}) with eltype Complex{Int64}:
 1 + 3im
 2 + 4im

julia> empty(S)
0-element StructArray(::Vector{Int64}, ::Vector{Int64}) with eltype Complex{Int64}
```
instead of
```julia
julia> empty(S)
Complex{Int64}[]
```
This behavior matches the docstring now: "Create an empty vector similar
to `v`". Often, `similar` will fall back to creating a `Vector`, so the
current behavior will be preserved.

~I'm unsure about what test to add for this, so suggestions are
welcome.~ Test added for a `StructArray` through a new test helper
1 parent c3836e1
History
Tip revision: 944f1809185455a1c57207983c1d0f8904343503 authored by Bogumił Kamiński on 25 March 2024, 15:18:44 UTC
Add Xoshiro reference to Random module docstring (#53784)
Tip revision: 944f180
File Mode Size
.devcontainer
.github
base
cli
contrib
deps
doc
etc
src
stdlib
test
.buildkite-external-version -rw-r--r-- 5 bytes
.clang-format -rw-r--r-- 3.3 KB
.clangd -rw-r--r-- 114 bytes
.codecov.yml -rw-r--r-- 52 bytes
.git-blame-ignore-revs -rw-r--r-- 371 bytes
.gitattributes -rw-r--r-- 65 bytes
.gitignore -rw-r--r-- 523 bytes
.mailmap -rw-r--r-- 12.7 KB
CITATION.bib -rw-r--r-- 513 bytes
CITATION.cff -rw-r--r-- 940 bytes
CONTRIBUTING.md -rw-r--r-- 23.4 KB
HISTORY.md -rw-r--r-- 372.8 KB
LICENSE.md -rw-r--r-- 1.3 KB
Make.inc -rw-r--r-- 55.9 KB
Makefile -rw-r--r-- 30.2 KB
NEWS.md -rw-r--r-- 10.0 KB
README.md -rw-r--r-- 7.4 KB
THIRDPARTY.md -rw-r--r-- 3.9 KB
VERSION -rw-r--r-- 11 bytes
julia.spdx.json -rw-r--r-- 37.8 KB
pkgimage.mk -rw-r--r-- 5.8 KB
sysimage.mk -rw-r--r-- 4.2 KB
typos.toml -rw-r--r-- 78 bytes

README.md

back to top