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

fix #36869, incorrect intersection with Union in supertype #36996

Merged
merged 1 commit into from
Aug 11, 2020

Conversation

JeffBezanson
Copy link
Member

I don't have a great solution to this, but fortunately in this case one of the types is concrete so a shortcut is possible.

The basic problem is the constraint Union{T, S} == Union{A, B}, where T and S are variables and A and B are types. We know the subtype relation holds, so that part is fine, but the values of T and S are not uniquely defined. In this case we were taking T == Union{A, B} and S == A. That makes it very difficult to use parameter values inferred from a supertype in intersection. As a next step we could perhaps try some heuristic for when it is "safe" to use the inferred values, e.g. if the variables appear as direct parameters of the supertype.

fixes #36869

@JeffBezanson JeffBezanson added types and dispatch Types, subtyping and method dispatch bugfix This change fixes an existing bug backport 1.5 labels Aug 11, 2020
@JeffBezanson JeffBezanson merged commit 102c9ac into master Aug 11, 2020
@JeffBezanson JeffBezanson deleted the jb/fix36869 branch August 11, 2020 16:30
simeonschaub pushed a commit to simeonschaub/julia that referenced this pull request Aug 11, 2020
KristofferC pushed a commit that referenced this pull request Aug 13, 2020
@KristofferC KristofferC mentioned this pull request Aug 13, 2020
25 tasks
KristofferC pushed a commit that referenced this pull request Aug 18, 2020
KristofferC pushed a commit that referenced this pull request Aug 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix This change fixes an existing bug types and dispatch Types, subtyping and method dispatch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

julia crashes during method disptch
2 participants