-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
WIP: fix #52385 by supporting Union{} inside Tuple{} #54792
base: master
Are you sure you want to change the base?
Conversation
Note most of the changes in 35e4a1f are generally good, so it doesn't need to be reverted. |
@@ -4386,6 +4381,24 @@ static int might_intersect_concrete(jl_value_t *a) | |||
return 0; | |||
} | |||
|
|||
static int is_uninhabited_tuple_type(jl_value_t *t) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we memoize this property in the tuple type?
I think this is the way we want to go, but messing with type intersection is pretty risky so I don't think we can merge this into 1.11 this late in the cycle. |
The optimization in #49393 needs to be reverted, as the TODO comment from before that PR is not a legal outcome if this PR is merged. The usages of the predicates for The Could you supply some numbers, once those are fixed, how much this affects the size and performance of OmniPackage and system images? |
That seems totally fine to me; in the context of methods we know an argument being |
This fixes the helpful example from #52385 (comment). More examples would be great.
This changes the "core" intersection algorithm to return e.g.
Tuple{Union{}}
for disjoint tuple elements; however there are wrappers around it that still giveUnion{}
since that is the result wanted for most use cases, e.g. argument types and types of values generally. The subtype.jl tests call the "core" algorithm as_type_intersect
which I have disabled for now. It will need separate tests.fix #52385