Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Adds method name to "no method matches" error #653

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

Merged
merged 1 commit into from
Jul 16, 2018
Merged

Adds method name to "no method matches" error #653

merged 1 commit into from
Jul 16, 2018

Conversation

AlexCatarino
Copy link
Contributor

What does this implement/fix? Explain your changes.

When a method does not find a match for given arguments, the thrown runtime error message does not informs us which method call failed.

Does this close any currently open issues?

No.

Any other comments?

No.

Checklist

Check all those that are applicable and complete.

@codecov
Copy link

codecov bot commented May 28, 2018

Codecov Report

Merging #653 into master will decrease coverage by 4.35%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #653      +/-   ##
==========================================
- Coverage   76.83%   72.48%   -4.36%     
==========================================
  Files          64       64              
  Lines        5587     5583       -4     
  Branches      891      889       -2     
==========================================
- Hits         4293     4047     -246     
- Misses       1003     1203     +200     
- Partials      291      333      +42
Flag Coverage Δ
#setup_linux 69.42% <ø> (ø) ⬆️
#setup_windows 71.66% <100%> (-4.36%) ⬇️
Impacted Files Coverage Δ
src/runtime/methodbinder.cs 78.36% <100%> (-12.25%) ⬇️
src/runtime/indexer.cs 52.38% <0%> (-33.34%) ⬇️
src/runtime/propertyobject.cs 45% <0%> (-25%) ⬇️
src/runtime/methodbinding.cs 64% <0%> (-16%) ⬇️
src/runtime/classderived.cs 75.33% <0%> (-13.01%) ⬇️
src/runtime/overload.cs 45.83% <0%> (-12.5%) ⬇️
src/runtime/moduleobject.cs 71.26% <0%> (-11.89%) ⬇️
src/runtime/delegateobject.cs 54.54% <0%> (-11.37%) ⬇️
src/runtime/classobject.cs 66.12% <0%> (-8.07%) ⬇️
... and 11 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d27ab61...b430679. Read the comment docs.

@@ -507,7 +507,7 @@ internal virtual IntPtr Invoke(IntPtr inst, IntPtr args, IntPtr kw, MethodBase i

if (binding == null)
{
Exceptions.SetError(Exceptions.TypeError, "No method matches given arguments");
Exceptions.SetError(Exceptions.TypeError, $"No method matches given arguments for {methodinfo[0].Name}");
Copy link
Member

Choose a reason for hiding this comment

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

How do you know that methodinfo is not null and that it contains at least one element?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Right, I will add a check for null and at least one element.
Thank you. I didn't came across those conditions in my application.

@filmor filmor merged commit 611814c into pythonnet:master Jul 16, 2018
@AlexCatarino AlexCatarino deleted the method-no-match-error branch December 18, 2019 15:13
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.

2 participants