Skip to content

fix isinplace inference and add inference tests #1019

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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

oscardssmith
Copy link
Member

@oscardssmith oscardssmith commented May 12, 2025

fixes #1017
This also removes NoMethodsError, TooManyArgumentsError, and TooFewArgumentsError and fixes inference for some *Function constructors`

end
throw(FunctionArgumentsError(fname, f))
Copy link
Member

Choose a reason for hiding this comment

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

This error message loses a lot of information. Can we in the error path do a method check and throw the more informative error message?

Copy link
Member Author

Choose a reason for hiding this comment

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

IMO the better method is to just put the expected nargs in the exception and then we can make the exception printing in charge of that logic. That way none of the complicated bits are in the main function.

@oscardssmith
Copy link
Member Author

I just remembered the tricky part here. This query isn't quite right (see JuliaLang/julia#56279 for details):

julia> f(a::Int, b) = true
f (generic function with 1 method)

julia> hasmethod(f, (Any, Any))
false # because !(Any<:Int)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

isinplace fails to infer on v1.10+
2 participants