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

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

Open
Keno opened this issue May 3, 2024 · 0 comments
Open
Labels
compiler:effects effect analysis domain:types and dispatch Types, subtyping and method dispatch

Comments

@Keno
Copy link
Member

Keno commented May 3, 2024

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)
@Seelengrab Seelengrab added the compiler:effects effect analysis label May 3, 2024
@nsajko nsajko added the domain:types and dispatch Types, subtyping and method dispatch label May 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler:effects effect analysis domain:types and dispatch Types, subtyping and method dispatch
Projects
None yet
Development

No branches or pull requests

3 participants