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 #33768, inference of _apply with strange argument list lengths #33832

Merged
merged 1 commit into from
Nov 13, 2019

Conversation

JeffBezanson
Copy link
Sponsor Member

fix #33768

@JeffBezanson JeffBezanson added bugfix This change fixes an existing bug compiler:inference Type inference labels Nov 13, 2019
return abstract_apply(nothing, argtypes[2], argtypes[3:end], vtypes, sv, max_methods)
ft = argtype_by_index(argtypes, 2)
ft === Bottom && return Bottom
return abstract_apply(nothing, ft, argtypes[3:end], vtypes, sv, max_methods)
Copy link
Sponsor Member

Choose a reason for hiding this comment

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

If index 2 can be bad, that seems to imply that 3:end would be bad too (vararg case)?

Copy link
Sponsor Member Author

Choose a reason for hiding this comment

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

It's ok, it just gives an empty array.

Copy link
Sponsor Member

Choose a reason for hiding this comment

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

right—that seems it'd be bad if argtypes = [f, Vararg{t}], since the slice should give [Vararg{t}]

Copy link
Member

Choose a reason for hiding this comment

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

I think that would probably be fine actually. I think the problematic part is argtypes = [Vararg{t}] since then argtypes[3:end] is [], but clearly there are args there.

@JeffBezanson JeffBezanson merged commit f196d3f into master Nov 13, 2019
@JeffBezanson JeffBezanson deleted the jb/fix33768 branch November 13, 2019 23:56
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.

Inference crash in handling of Core._apply_iterate
3 participants