Skip to content

Effects modeling for Unions constructed from typevars could probably be better #54340

Open

Description

These functions return equal types, but the compiler does not know a lot about the effects of f, producing worse code:

julia> f() = Union{<:AbstractArray, <:Tuple}
f (generic function with 1 method)

julia> g() = Union{AbstractArray, Tuple}
g (generic function with 1 method)

julia> Base.infer_effects(f)
(?c,+e,!n,+t,+s,+m,+u)

julia> Base.infer_effects(g)
(+c,+e,+n,+t,+s,+m,+u)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions