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

Make Vararg not a DataType #38136

Merged
merged 1 commit into from
Dec 15, 2020
Merged

Make Vararg not a DataType #38136

merged 1 commit into from
Dec 15, 2020

Commits on Dec 15, 2020

  1. Make Vararg not a DataType

    Currently `Vararg` is a DataType, but is special cased in a
    bunch of places to give it special behavior (e.g. in subtyping
    and of course in tuple construction). However, unlike all other
    DataTypes, it cannot appear as a type parameter, which caused trouble in
    PR #38071. Having it be a DataType is a bit of a pun of convenience
    in the first place - it's a lot more similar to a tvar (which can
    be considered an implementation detail of UnionAll in the same way
    Vararg is an implementation detail of Tuple), which has its own
    non-type object. This PR does the same to Vararg, and moves it
    from being an abstract DataType with special cased behavior to
    its own custom type (called `Core.TypeofVararg`). There are a
    few small behavior differences, but they are mostly internal.
    In particular, we no longer have `Vararg <: Type` and Vararg
    objects no longer have the .parameters field. Also, things like
    `Vararg{T} where T` are technically illegal now since Vararg is
    not a type. However, since a lot of people are using that pattern,
    I've brought it back with a deprecation (which is of course off
    by default). The only things that's disallowed is `Vararg{N, N} where N`,
    but I haven't seen anybody use that.
    Keno committed Dec 15, 2020
    Configuration menu
    Copy the full SHA
    3b1e166 View commit details
    Browse the repository at this point in the history