- 
          
- 
        Couldn't load subscription status. 
- Fork 5.7k
          Allow effect inference of eltype(::Tuple)
          #48322
        
          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
Conversation
By bumping max_methods for `eltype` slightly to cover all four Tuple methods.
| Would this be generally useful? I mean, if this improvement is useful especially for some external  | 
| Yes, it allowed inference to know that  | 
The `eltype` function was one of the few functions in the sysimage with
a `max_methods` value (the world-splitting threshold) greater than the
default. This was a workaround for the unnecessarily large number of
methods of `eltype(::Type{<:Tuple})`. The `max_methods` value was
increased in PR JuliaLang#48322 to help effect inference.
Reduce the number of `eltype(::Type{<:Tuple})` methods, which then also
allows keeping the `max_methods` for `eltype` at the default value.
The intent here is to guard against unnecessary invalidation of the
sysimage or other precompiled code, which might require decreasing the
`max_methods` value to the natural minimum for many interface functions,
by which I mean "generic function meant to have methods added to it by
package authors". See also: PR JuliaLang#57884.
    The `eltype` function was one of the few functions in the sysimage with
a `max_methods` value (the world-splitting threshold) greater than the
default. This was a workaround for the unnecessarily large number of
methods of `eltype(::Type{<:Tuple})`. The `max_methods` value was
increased in PR JuliaLang#48322 to help effect inference.
Reduce the number of `eltype(::Type{<:Tuple})` methods, which then also
allows keeping the `max_methods` for `eltype` at the default value.
The intent here is to guard against unnecessary invalidation of the
sysimage or other precompiled code, which might require decreasing the
`max_methods` value to the natural minimum for many interface
functions, by which I mean "generic function meant to have methods
added to it by package authors". I intend to approach this issue in
following PRs. See also: PR JuliaLang#57884.
Regarding future work: I consider the "natural minimum" value for
interface functions taking types to be **two**, because the bottom type
subtypes each type. If the interface function doesn't accept types, the
natural minimum should be **one**.
    The `eltype` function was one of the few functions in the sysimage with
a `max_methods` value (the world-splitting threshold) greater than the
default. This was a workaround for the unnecessarily large number of
methods of `eltype(::Type{<:Tuple})`. The `max_methods` value was
increased in PR JuliaLang#48322 to help effect inference.
Reduce the number of `eltype(::Type{<:Tuple})` methods, which then also
allows keeping the `max_methods` for `eltype` at the default value.
The intent here is to guard against unnecessary invalidation of the
sysimage or other precompiled code, which might require decreasing the
`max_methods` value to the natural minimum for many interface
functions, by which I mean "generic function meant to have methods
added to it by package authors". I intend to approach this issue in
following PRs. See also: PR JuliaLang#57884.
Regarding future work: I consider the "natural minimum" value for
interface functions taking types to be **two**, because the bottom type
subtypes each type. If the interface function doesn't accept types, the
natural minimum should be **one**.
    #58788) The `eltype` function was one of the few functions in the sysimage with a `max_methods` value (the world-splitting threshold) greater than the default. This was a workaround for the unnecessarily large number of methods of `eltype(::Type{<:Tuple})`. The `max_methods` value was increased in PR #48322 to help effect inference.
By bumping max_methods for
eltypeslightly to cover all four Tuple methods.