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 #32465, inference of splatting unionall NamedTuple types #32494

Merged
merged 2 commits into from
Jul 5, 2019

Conversation

JeffBezanson
Copy link
Member

fixes #32465

@JeffBezanson JeffBezanson added bugfix This change fixes an existing bug compiler:inference Type inference backport 1.2 labels Jul 3, 2019
Copy link
Member

@vtjnash vtjnash left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wrote up a comment about what I think this logic is intended to do.

A more literal translation of the comment into code seems to be:

tti0 = rewrap_unionall(tti.parameters[2], tti0)
# optional: has_free_typevars(tti) && return Any[Vararg{Any}]
tti = unwrap_unionall(tti0)

These are usually the same thing, I think the only case they differ is if the Tuple parameter was itself a UnionAll (in which case the PR would be still correct, but less optimal).

base/compiler/abstractinterpretation.jl Show resolved Hide resolved
Co-Authored-By: Jameson Nash <vtjnash@gmail.com>
@JeffBezanson JeffBezanson merged commit 2350c04 into master Jul 5, 2019
@JeffBezanson JeffBezanson deleted the jb/fix32465 branch July 5, 2019 16:14
KristofferC pushed a commit that referenced this pull request Jul 8, 2019
@KristofferC KristofferC mentioned this pull request Jul 8, 2019
32 tasks
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 compiler:inference Type inference
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Internal error: encountered unexpected error in runtime: TypeError
3 participants