-
Notifications
You must be signed in to change notification settings - Fork 4
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
methods with unbound static parameters #83
Comments
NB: in all four methods the relevant static parameter is only unbound for some invocations. E.g., bound for nonempty |
I've never used the What does it mean for a parameter to be unbound? When In general if you have a Is this a false positive by |
Not sure without taking a look at the code, but it'd be a good practice to fix those.
It means it has no value.
No, the parameter
Yes.
A static parameter being unbound during the invocation of a method can slow down the call, if I'm not mistaken. Trying to use an unbound static parameter in the method body will obviously result in an error. If you're sure that the method only gets called in such a manner that the static parameter is bound, you could ignore this. However then you stand to miss actual issues in the future, so it'd be best to have no potential unbound parameters. Also see the Aqua.jl package, often used in a package's test suite: https://juliahub.com/ui/Packages/General/Aqua
This form is just fine, as long as the method parameter is otherwise sufficiently constrained.
Yeah, this would certainly be fine, although adding an extra argument would be less of a hassle, like this:
I'd say it's a true positive, at least looking at the method in isolation. |
BTW, taking a look at one of the flagged methods: FastDifferentiation.jl/src/ExpressionGraph.jl Lines 634 to 641 in 91857e7
The type parameter isn't used at all in the method body, so it's possible just not using a type parameter would be best. |
…nate unnecessary dependencies #82 (comment)
The text was updated successfully, but these errors were encountered: