Fix depending on the method of a sub parameter object #765
+115
−2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #764
This PR fixes a regression that was introduced in #753. It appeared that depending on a method was pretty much untested so I have added some more tests.
When
_spec_to_obj
resolves a dependency on a Parameterized method, the type of the resolved method is:FunctionType
if it's a direct dependency, as in@param.depends('method')
. The object holding the reference to the method seen by_spec_to_obj
is a class.MethodType
if it's a dependency on a sub object, as in@param.depends('sub.method')
. The object holding the reference to the method seen by_spec_to_obj
is an instance.Good to know!
The change made in this PR is pretty simple, I'll however kindly ask @philippjfr to review it to ensure that this is correct, and check that the problem actually doesn't lie with how the object holding the method reference is resolved (class vs. instance).