Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Broaden array constructor to allow any fill value #41562

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Commits on Jul 12, 2021

  1. Broaden array constructor to allow any fill value

    It seems odd to me that `Array{Union{Missing, T}}(missing, n...)` and `Array{Union{Nothing, T}}(nothing, n...)` exist but the more general case `Array{T}(x::T, n...)` does not. 
    
    There are some potential issues I'm sure. Notably it makes `Array{T}(undef, n...)` seem even more of an odd one out, rather than just the only strange one out of three options (the other two being `nothing` and `missing`. But I'm inclined to think this reduces the inconsistency since there are only two options, `x::UndefInitializer` and `x::T`.
    Will Kimmerer committed Jul 12, 2021
    Configuration menu
    Copy the full SHA
    fa96327 View commit details
    Browse the repository at this point in the history